-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasm.txt
130 lines (86 loc) · 789 Bytes
/
asm.txt
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
PUSH 0
POP [15]
PUSH [15]
PUSH 2
ADD
PUSH 1
JA IF_END0
PUSH 0
JMP IF_FALSE0
IF_END0:
PUSH 1
IF_FALSE0:
POP [15]
PUSH 2
POP [16]
PUSH 24
POP [17]
PUSH 0
POP [18]
PUSH 3
POP [19]
PUSH [17]
PUSH 111
ADD
POP [15]
PUSH [19]
OUT
PUSH [15]
PUSH 0
JB IF_FALSE1
JMP IF_END1
IF_FALSE1:
PUSH [15]
OUT
IF_END1:
PUSH 345
OUT
PUSH [18]
CALL examle
HLT
examle:
POP [2]
POP [1]
PUSH 3
PUSH [1]
ADD
POP [4]
PUSH [4]
POP [3]
PUSH 1
POP [6]
PUSH [6]
POP [5]
PUSH 0
POP [7]
PUSH 0
POP [8]
PUSH 12
PUSH 0
JB IF_FALSE2
PUSH 1
POP [3]
JMP IF_END2
IF_FALSE2:
IF_END2:
WHILE_HEAD3:
PUSH [3]
PUSH 0
JB WHILE_END3
PUSH 0
POP [9]
JMP WHILE_HEAD3
WHILE_END3:
PUSH 3
PUSH [3]
SUB
POP [10]
PUSH 24
POP [11]
PUSH 0
POP [12]
PUSH 3
POP [13]
PUSH 1
POP [3]
RET