Page 1 of 1

Problems in nasm

Posted: Fri Nov 19, 2004 10:48 pm
by St8ic
How could I get this code to work in nasm?

Code: Select all

mov ax,word ptr [si+bx]
Thanks.

Re:Problems in nasm

Posted: Sat Nov 20, 2004 5:37 am
by DennisCGc
St8ic wrote: How could I get this code to work in nasm?

Code: Select all

mov ax,word ptr [si+bx]
Thanks.

Code: Select all

mov ax,[si+bx]

Re:Problems in nasm

Posted: Sat Nov 20, 2004 11:55 am
by Candy
DennisCGc wrote:
St8ic wrote: How could I get this code to work in nasm?

Code: Select all

mov ax,word ptr [si+bx]
Thanks.

Code: Select all

mov ax,[si+bx]
You remove some semantics.

Code: Select all

mov ax, word [si+bx]
nasm's point of view is that it must obviously be a pointer or you wouldn't use the [] 's, so the "ptr" is just filler and can be left out.

Re:Problems in nasm

Posted: Sat Nov 20, 2004 12:27 pm
by St8ic
Translating to nasm is hard! Thanks for that help by the way, I really should've thought of that myself. ;)

Here are some other problem lines:
Buffer DB 512, DUP, (0) <- Pretty sure it's the 'DUP'
mov [si+24h],"$"

Re:Problems in nasm

Posted: Sat Nov 20, 2004 1:14 pm
by Candy
St8ic wrote: Translating to nasm is hard! Thanks for that help by the way, I really should've thought of that myself. ;)

Here are some other problem lines:
Buffer DB 512, DUP, (0) <- Pretty sure it's the 'DUP'
mov [si+24h],"$"

not sure what the buffer is supposed to be, but if it was to be 512 empty characters, try:

Code: Select all

buffer  times 512 db 0

Re:Problems in nasm

Posted: Sat Nov 20, 2004 3:15 pm
by St8ic
Should work, I guess. What about the other line? Any ideas?

Re:Problems in nasm

Posted: Sat Nov 20, 2004 4:33 pm
by Candy
St8ic wrote: Should work, I guess. What about the other line? Any ideas?

Code: Select all

mov [si+24h],byte '$'