flat assembler
Message board for the users of flat assembler.
Index
> Linux > Increasing offset whilst reading/writing |
Author |
|
LocoDelAssembly 17 Oct 2010, 17:05
Since you posted in Linux, you need 32-bit addresses, therefore you need to use ECX instead of just CL (lower 8 bits of ECX).
For your first code you could do this: Code: mov ecx, 0 .loop: mov byte [zeugs+ecx], 18h inc ecx cmp ecx, 10 jbe .loop And to copy one array into another: Code: mov ecx, 0 mov edi, dstArray mov esi, srcArray .loop: mov al, [srcArray+ecx] mov [dstArray+ecx], al inc ecx cmp ecx, srcArraySize jb .loop Or just: Code: mov ecx, srcArraySize mov edi, dstArray mov esi, srcArray rep movs byte[edi], byte[esi] |
|||
17 Oct 2010, 17:05 |
|
andyz74 17 Oct 2010, 18:04
OK, this seems to work with the 32-bit-registers. No more compilation-errors.
Many thanks for the fast help! |
|||
17 Oct 2010, 18:04 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.