user3885166
user3885166

Reputation: 215

Moving through allocated bytes

I have following declaration data:

temp db 50 DUP(0)

How do I access each byte? Let's say I do mov temp, 48 and then want to move 49 into the next byte of the allocated ones. I tried to

inc temp
mov temp, 49

but it just increased temp value to 49

Upvotes: 0

Views: 43

Answers (1)

E.g.

mov [temp + 1], 49

or, if you want to dynamically select the slot in temp to store a value in

mov [temp + ebx], 49

where ebx holds the index value (could be any register)

Upvotes: 1

Related Questions