summaryrefslogtreecommitdiff
path: root/ecomp-c/tests/boolean_variable.easm
blob: a884de73fde80edca97b2df5e998589115ca1c0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
format binary
use32
org $1000000
; DECL a -> integer
; DECL b -> integer
; DECL flag -> boolean
; LET a <- 1 
mov eax, 1
push eax
pop eax
mov [a], eax
; LET b <- 2 
mov eax, 2
push eax
pop eax
mov [b], eax
; LET flag <- a b = 
mov eax, [a]
push eax
mov eax, [b]
push eax
pop ebx
pop eax
cmp eax, ebx
je __global_0
mov eax, 0
jmp __global_1
__global_0: mov eax, 1
__global_1:
push eax
pop eax
mov [flag], eax
hlt
flag: db $00
b: dd $00000000
a: dd $00000000