Problems in nasm

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
St8ic

Problems in nasm

Post by St8ic »

How could I get this code to work in nasm?

Code: Select all

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

Re:Problems in nasm

Post 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]
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Problems in nasm

Post 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.
St8ic

Re:Problems in nasm

Post 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],"$"
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Problems in nasm

Post 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
St8ic

Re:Problems in nasm

Post by St8ic »

Should work, I guess. What about the other line? Any ideas?
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Problems in nasm

Post by Candy »

St8ic wrote: Should work, I guess. What about the other line? Any ideas?

Code: Select all

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