News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

question on using mov [di], 0

Started by ninjarider, August 26, 2006, 11:15:24 PM

Previous topic - Next topic

ninjarider

if i remember correctly you can use a register to point to a memory address

im currently using this code

stosb
xor ax, ax
stosb
dec di


whenever i use this code

stosb
mov [di], 0

i get an error message about the mov instruction

I am using the masm32 9 with the 16-bit linker. the code is setup using .186

why am i getting the error message?

raymond

That's because the assembler doesn't know if you want to store a byte or a word at that address. You have to specify it as follows:

mov byte ptr[di], 0
mov word ptr[di], 0

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

ninjarider

thnx. i thought i was missing something