format binary use32 org $1000000 jmp __global_0 ; CONST N -> integer, 1 ; CONST M -> integer, 3 ; DECL x -> integer, 1 ; DECL y -> array 3 of integer, array 3 of integer = { ... } ; PROC A __global_A: push ebp push esp pop ebp ; CONST N -> integer, 2 ; DECL x -> array 2 of integer, array 2 of integer = { ... } ; DECL y -> array 3 of integer, array 3 of integer = { ... } ; DECL z -> integer, 0 ; local z, offset: 4, size: 4 ; local y, offset: 16, size: 12 ; local x, offset: 24, size: 8 mov eax, 24 sub esp, eax push ebp pop ebx mov eax, 4 sub ebx, eax mov eax, 0 mov [ebx], eax ; LET x[2 1 - ] <- 3 mov eax, 2 push eax mov eax, 1 push eax pop ebx pop eax sub eax, ebx push eax pop eax mov ebx, 4 mul ebx push eax push ebp pop eax mov ebx, 24 sub eax, ebx pop ebx add eax, ebx push eax mov eax, 3 push eax pop eax pop ebx mov [ebx], eax ; LET z <- 4 mov eax, 4 push eax push ebp pop ebx mov eax, 4 sub ebx, eax pop eax mov [ebx], eax mov eax, 24 add esp, eax pop ebp ret ; PROC B __global_B: push ebp push esp pop ebp ; LET x <- 1 mov eax, 1 push eax pop eax mov [x], eax pop ebp ret __global_0: ; LET y[0 ] <- 7 mov eax, 0 push eax pop eax mov ebx, 4 mul ebx push eax mov eax, y pop ebx add eax, ebx push eax mov eax, 7 push eax pop eax pop ebx mov [ebx], eax ; CALL __global_A call __global_A ; CALL __global_B call __global_B hlt y: dd $00000000 dd $00000000 dd $00000000 x: dd $00000001