test5.sm
523 Bytes
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
.text
plus:
push 0
link
push 2
local
load
push 1
local
load
add
push 3
local
store
unlink
jump
program:
push 0
link
push 0 # reserva espaço para retorno de read_int
push read_int
call
#
dup
push print_int
call
pop
#
push 3
mul
#
dup
push print_int
call
pop
#
push 0 # reserva espaço para retorno de plus
swap # repõe o outro no topo
push 2
push plus
call
pop # retira argumento
pop # retira argumento
push print_int
call
pop
unlink
jump