flat assembler
Message board for the users of flat assembler.
Index
> Main > Array |
Author |
|
shoorick 05 Sep 2008, 06:12
in real mode not all registers can be used as indexing. also, displacement is 16-bit and must be summed with 16-bit numbers also
try this: mov bx,1 lea di,[B + bx] (fasm syntaxis) btw, this will place byte from array into al, not its offset: mov al,[B + bx] i have use al instead di here, because di is 16-bit register and not designed to work with 8-bit values, as i see your array is sequence of bytes |
|||
05 Sep 2008, 06:12 |
|
Richi 05 Sep 2008, 06:55
Thank you, I will try that! Is it not a problem that a 16 bit reg (bx) is forced into a 8 bit reg (al)?
mov al,[B + bx] |
|||
05 Sep 2008, 06:55 |
|
baldr 06 Sep 2008, 14:20
As shoorick said, mov al, [B+bx] puts the byte at the address B+bx into al, not the address of that byte. Use lea instruction if you want to load the address.
|
|||
06 Sep 2008, 14:20 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.