flat assembler
Message board for the users of flat assembler.
Index
> Main > Multi-dimensional arrays... |
Author |
|
bitRAKE 14 Aug 2008, 01:42
One way...
Code: ARRAY_WIDTH = 10 ARRAY_HEIGHT = 10 mov eax,[X] imul ebx,[Y],4*ARRAY_WIDTH mov ecx,[array+eax*4+ebx] array rd ARRAY_WIDTH * ARRAY_HEIGHT Edit: thx, LocoDelAssembly _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup Last edited by bitRAKE on 14 Aug 2008, 02:16; edited 1 time in total |
|||
14 Aug 2008, 01:42 |
|
LocoDelAssembly 14 Aug 2008, 01:58
dd must be rd
|
|||
14 Aug 2008, 01:58 |
|
Patrick_ 14 Aug 2008, 13:22
Yeah, that should've been an 'rd'.
Thanks guys. For some reason I thought it wouldn't require an extra instruction but it does. |
|||
14 Aug 2008, 13:22 |
|
Azu 08 Jun 2009, 00:34
If you aligned the array on 4byte boundary shouldn't the lea way work then? Since it would be multiples of 4?
|
|||
08 Jun 2009, 00:34 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.