Hello there again!
I have a problem, with a words array. I declared my array in the following way:
line_points resw 4

Then, I want to do this:
mov, ,10
mov, ,11
mov, ,12
mov, ,13

But the only valid word, is the one in , the previous ones seem to get corrupted, always the last one is right. I check this, using an integer printing function that I wrote, which I'm sure works just fine. I guess it's some lack in my knowledge about addressing, and I'd be happy if someone could tell me what I'm doing wrong. Oh, and I'm checking it like this:

mov ax,
call intprint
mov ax,
call intprint
...and so on
Posted on 2007-03-06 13:59:39 by zdebel

Hello there again!
I have a problem, with a words array. I declared my array in the following way:
line_points resw 4

Then, I want to do this:
mov, ,10
mov, ,11
mov, ,12
mov, ,13

But the only valid word, is the one in , the previous ones seem to get corrupted, always the last one is right. I check this, using an integer printing function that I wrote, which I'm sure works just fine. I guess it's some lack in my knowledge about addressing, and I'd be happy if someone could tell me what I'm doing wrong. Oh, and I'm checking it like this:

mov ax,
call intprint
mov ax,
call intprint
...and so on



RESW only reserves the specified amount of WORDS. You still need to access that memory pointer properly.

You are currently attempting to access the BYTE values (+0, +1, +2, +3) instead of the WORD values (+0, +2, +4, +6). This also applies for your test code.
Posted on 2007-03-06 17:40:51 by SpooK
ah....  :oops:
Thank you very much ^^
Posted on 2007-03-07 09:32:43 by zdebel

ah....  :oops:
Thank you very much ^^


No worries. Just remember, with NASM, you must execute complete control over your program. MASM differs by issuing variables, and other aspects, in a C-like manner.

As per the NASM Manual... "NASM doesn't ASSUME!!!" :)
Posted on 2007-03-07 15:13:29 by SpooK