D - Assembly in D
2 flaws I've found so far: you can't name data, such as: hello db "Hello, world!$" and, do register names really HAVE to be upper-case? Why can't they be lower case, too?
Jan 26 2004
"kinghajj" <kinghajj_member pathlink.com> wrote in message news:bv4bm6$2j6q$1 digitaldaemon.com...2 flaws I've found so far: you can't name data, such as: hello db "Hello, world!$"Add a : after the label: hello: db "dddd";and, do register names really HAVE to be upper-case? Why can't they belowercase, too?Because it has to tokenize like the rest of the D language, and keywords are case sensitive. It makes it a lot simpler.
Jan 26 2004
this still doesn't work:
asm
{
hello: db "Hello world!$";
mov AH, 0x09;
mov DX, hello;
int 0x21;
}
error: undefined identifier 'hello'
any suggestions?
Jan 26 2004
"kinghajj" <kinghajj_member pathlink.com> wrote in message
news:bv4jjk$2vs4$1 digitaldaemon.com...
this still doesn't work:
asm
{
hello: db "Hello world!$";
mov AH, 0x09;
mov DX, hello;
int 0x21;
}
error: undefined identifier 'hello'
any suggestions?
char[] hello = "hello world!$";
asm
{
mov AH, 0x09;
mov DX, offset hello;
int 0x21;
}
Jan 26 2004
Still doesn't work:
char[] hello = "Hello, world$";
asm
{
mov AH, 0x09;
mov DX, offset hello; // <- error here
int 0x21;
}
still doesn't work
error: bad type/size of operands 'mov'
too big of a memory address?
Jan 26 2004
DX i think is a 16 bit register, and addresses are 32 bits. try moving the
address into a 32 bit register like eax
In article <bv4uge$gb0$1 digitaldaemon.com>, kinghajj says...
Still doesn't work:
char[] hello = "Hello, world$";
asm
{
mov AH, 0x09;
mov DX, offset hello; // <- error here
int 0x21;
}
still doesn't work
error: bad type/size of operands 'mov'
too big of a memory address?
Jan 27 2004








imr1984 <imr1984_member pathlink.com>