format binary use32 org $1000000 jmp __global_0 ; DECL a -> integer, 0 ; DECL b -> integer, 0 ; DECL c -> integer, 0 ; DECL d -> integer, 0 __global_0: ; LET a <- 2 mov eax, 2 push eax pop eax mov [a], eax ; LET b <- 1 mov eax, 1 push eax pop eax mov [b], eax ; LET c <- 3 mov eax, 3 push eax pop eax mov [c], eax ; TEST a b > a c <= and ; expr left mov eax, [a] push eax mov eax, [b] push eax pop ebx pop eax cmp eax, ebx ja __global_4 mov eax, 0 jmp __global_5 __global_4: mov eax, 1 __global_5: push eax pop eax mov ebx, 0 cmp eax, ebx je __global_3 ; expr right mov eax, [a] push eax mov eax, [c] push eax pop ebx pop eax cmp eax, ebx jbe __global_6 mov eax, 0 jmp __global_7 __global_6: mov eax, 1 __global_7: push eax pop eax __global_3: push eax pop eax mov ebx, 0 cmp eax, ebx je __global_1 ; LET d <- 42 mov eax, 42 push eax pop eax mov [d], eax jmp __global_2 __global_1: ; LET d <- 0 mov eax, 0 push eax pop eax mov [d], eax __global_2: hlt d: dd $00000000 c: dd $00000000 b: dd $00000000 a: dd $00000000