-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtable.asm
More file actions
55 lines (40 loc) · 656 Bytes
/
table.asm
File metadata and controls
55 lines (40 loc) · 656 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
50
51
52
53
54
55
toggle_verbose 1
jmp .start
table:
mov 10, $arg_b
cmp $arg_a, $arg_b
je .table_ten
mov 20, $arg_b
cmp $arg_a, $arg_b
je .table_twenty
mov 30, $arg_b
cmp $arg_a, $arg_b
je .table_thirty
jmp .table_unknown
table_ten:
mov 10, $ret
ret
table_twenty:
mov 20, $ret
ret
table_thirty:
mov 30, $ret
ret
table_unknown:
mov -1, $ret
ret
start:
mov 10, $arg_a
call .table
ld $ret, $1
mov 20, $arg_a
call .table
ld $ret, $2
mov 30, $arg_a
call .table
ld $ret, $3
mov 185, $arg_a
call .table
ld $ret, $4
register_dump $1, $4
halt