summaryrefslogtreecommitdiff
path: root/ecomp-c/tests/boolean_variable.easm
blob: 7b64339022c2f0138a96fcf8ee4f3741b42c9dbe (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, 0
; DECL b -> integer, 0
; DECL flag -> boolean, 0
; 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
jne __global_0
mov eax, 0
jmp __global_1
__global_0: mov eax, 1
__global_1:
push eax
pop eax
mov [flag], eax
hlt
flag: dd $00000000
b: dd $00000000
a: dd $00000000