summaryrefslogtreecommitdiff
path: root/ecomp-c/tests/boolean_variable.easm
blob: e6b0173cbc2e42a17103bda069fcf865092edc64 (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
37
38
format binary
use32
org $1000000
jmp __global_0
; DECL a -> integer, 0
; DECL b -> integer, 0
; DECL flag -> boolean, false
__global_0:
; LET a <- 573785173 
mov eax, 573785173
push eax
pop eax
mov [a], eax
; LET b <- 1719109785 
mov eax, 1719109785
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_1
mov eax, 0
jmp __global_2
__global_1: mov eax, 1
__global_2:
push eax
pop eax
mov [flag], al
hlt
flag: db $00
b: dd $00000000
a: dd $00000000