Thread overview |
---|
January 27, 2004 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? |
January 27, 2004 Re: Assembly in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinghajj | "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 Re: Assembly in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | 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 Re: Assembly in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinghajj | "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 Re: Assembly in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | 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 Re: Assembly in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinghajj | 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? > > |
Copyright © 1999-2021 by the D Language Foundation