| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Compiler, linker, assembl |
DV> If this is so, how do you use inline assembly??
DV> asm {
DV> MOV DX,'hello world.'
DV> MOV AH,9
DV> INT 21H
DV> };
DV> Is that how you would print the string "hello world" using
DV> inline assembly?? If not can you give an example????
That may be how you would do it in assembly.
In C, I would skip the inline and just use
printf("hello world.");
I DID try to print 'hello world' using asm, though.
I eventually found that this will work:
int main(void)
{
int s = (int)"Hello world.$";
_asm {
MOV DX, s
MOV AH,9h
INT 21H
};
return 0;
}
This worked both in QC2.5 and BC++3.1.
The point is that asm is not usually needed, and ruins any
pretense of portability. A separately produced asm .OBJ will
keep your code portable while still relying on an outside
module which may be rewritten for every platform to which
your code is to be ported. It is a more reusable method.
> ] * Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)SEEN-BY: 396/1 622/419 632/371 633/260 267 270 371 634/397 635/506 728 SEEN-BY: 639/252 670/213 218 @PATH: 154/750 222 396/1 633/260 635/506 728 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.