-
Notifications
You must be signed in to change notification settings - Fork 0
/
hello.eir
74 lines (74 loc) · 818 Bytes
/
hello.eir
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.text
main:
#{push:main}
mov D, SP
add D, -1
store BP, D
mov SP, D
mov BP, SP
sub SP, 1
.file 1 "-"
.loc 1 7 0
.loc 1 4 0
mov A, 0
mov B, SP
.data
.L3:
.string "Hello, world!\n"
.text
mov A, .L3
mov B, BP
add B, 16777215
store A, B
.loc 1 5 0
.L0:
.loc 1 4 0
mov B, BP
add B, 16777215
load A, B
mov B, A
load A, B
jeq .L4, A, 0
jmp .L5
.L4:
.loc 1 5 0
jmp .L2
.L5:
.loc 1 4 0
mov B, BP
add B, 16777215
load A, B
mov B, A
load A, B
mov D, SP
add D, -1
store A, D
mov SP, D
putc A
add SP, 1
.loc 1 5 0
.L1:
.loc 1 4 0
mov B, BP
add B, 16777215
load A, B
mov D, SP
add D, -1
store A, D
mov SP, D
add A, 1
mov B, BP
add B, 16777215
store A, B
load A, SP
add SP, 1
.loc 1 5 0
jmp .L0
.L2:
.loc 1 7 0
mov A, 0
mov B, A
#{pop:main}
exit
#{pop:main}
exit