Thread overview
Assembly in D
Jan 27, 2004
kinghajj
Jan 27, 2004
Walter
Jan 27, 2004
kinghajj
Jan 27, 2004
Walter
Jan 27, 2004
kinghajj
Jan 27, 2004
imr1984
January 27, 2004
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?


January 27, 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 be
lower
> case, too?

Because it has to tokenize like the rest of the D language, and keywords are case sensitive. It makes it a lot simpler.


January 27, 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?


January 27, 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;
}


January 27, 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?


January 27, 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?
>
>