Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %define BPE 4 ; Byte Per Element
- ; dword array_2D[3][4] <=> tableau 2D à 4 lignes et 5 colonne (zero compte)
- ; array_2D[2][2]
- mov eax, 2 ; y
- mul dword [max_x] ; eax *= [max_x] <=> (y * max_x) <=> Select line of array
- add eax, 2 * BPE ; (y * max_x) + x <=> (2 * 20) + 8 <=> 48
- mov [array_2D + eax], dword 23 ; Target array_2D[2][2] <=> array_2D[48]
- max_x dd 5 * BPE ; <=> 20
- ; 0 1 2 3 4
- ;
- array_2D: dd 0, 0, 0, 0, 0 ; 0 0( 0), 1( 4), 2( 8), 3(12), 4(16)
- dd 0, 0, 0, 0, 0 ; 1 5(20), 6(24), 7(28), 8(32), 9(36)
- dd 0, 0, 0, 0, 0 ; 2 10(40), 11(44), 12(48), 13(52), 14(56)
- dd 0, 0, 0, 0, 0 ; 3 15(60), 16(64), 17(68), 18(62), 19(66)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement