flat assembler
Message board for the users of flat assembler.
Index
> Main > translating syntax for HLA array? |
Author |
|
r22 01 Jul 2005, 01:02
A 2d matrix is just an index mapped 1d matrix
4x4 0 1 2 3 4 5 6 7 8 9 1011 12131415 so matrix4x4 rd 4*4 ; reserve 16 dwords for a 4x4 matrix to access IE: MOV ECX, INDEX ; 0 - 15 MOV EAX, dword [matrix4x4 + ECX * 4] ;4 because dword is 4bytes Using RD (reserve dword should work just fine for you. Just have to make any indexes 1d instead of 2d matrix2x3 rd 2*3 matrix3x4 rd 3*4 |
|||
01 Jul 2005, 01:02 |
|
Matrix 01 Jul 2005, 06:35
Hy jdawg,
if you are sticked to the multi imensional arrays, you can use this kind of approach Code: ;to access ELEMENTS: MOV EBX, [xmatrix]; 0 - 3 MOV ECX, [ymatrix]; 0 - 3 SHL ECX, 4 MOV EAX, dword [matrix4x4 + ECX + EBX * 4] ymatrix rd ? xmatrix rd ? matrix4x4 rd 4*4 ; reserve 16 dwords for a 4x4 matrix |
|||
01 Jul 2005, 06:35 |
|
jdawg 02 Jul 2005, 19:58
Thanks for the input I found that r22's post was what I needed to do. But I might try the two single matrix approach as well
|
|||
02 Jul 2005, 19:58 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.