-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path190325b.s
75 lines (67 loc) · 829 Bytes
/
190325b.s
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
stk 16
org 0
; v=true(x,y)
; x=r2, y=r3, v=r1
lbl 1
mov r1, r2
ret
; v=false(x,y)
; x=r2, y=r3, v=r1
lbl 2
mov r1, r3
ret
; v=and(b1, b2)
; v=1|2;r1, b1=r2, b2=r3
lbl 3
jz_ r2, 4
jz_ r3, 4
mov r1, 1
ret
lbl 4
mov r1, 2
ret
; v=not(b)
; v=1|2;r1, b=r2
lbl 5
jz_ r2, 6
mov r1, 2
ret
lbl 6
mov r1, 1
ret
; v=or(b1, b2)
; v=1|2;r1, b1=r2, b2=r3
lbl 7
jnz r2, 8
jnz r3, 8
mov r1, 2
ret
lbl 8
mov r1, 1
ret
; v=xor(b1, b2)
; v=1|2;r1, b1=r2, b2=r3
; r2 is trashed.
lbl 9
jnz r2, 8
jnz r3, 8
lbl 10
mov r1, 2
ret
lbl 8
eq_ r2, r3
jnz r2, 10
mov r1, 1
ret
; v=implies(b1, b2)
; v=1|2;r1, b1=r2, b2=r3
; r2 is trashed.
lbl 11
jz_ r2, 12
lbl 13
mov r1, 1
ret
lbl 12
jnz r3, 13
mov r1, 2
ret