Message board for the users of flat assembler.
> Main > translating syntax for HLA array?
I'm looking for a way to translate this array into FASM v 1.43 from HLA
The only way I could get the source to assemble was to use this
matrix4x4: times 4-4 dd ?
Is this a correct translation?
If not how would I translate it and if so would the correct translation for
FASM v 1.62 be this?
matrix4x4: dup 4-4 dd ?
|30 Jun 2005, 23:24||
A 2d matrix is just an index mapped 1d matrix
0 1 2 3
4 5 6 7
8 9 1011
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||
if you are sticked to the multi imensional arrays, you can use this kind of approach
;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||
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 >
Copyright © 1999-2020, Tomasz Grysztar.
Powered by rwasa.