-
Notifications
You must be signed in to change notification settings - Fork 0
/
combined.kernel
126 lines (81 loc) · 1.93 KB
/
combined.kernel
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
ldi $15, 0b111111 ; 63 bitmask
ldi $14, 64 ; width & height
and $7, $15, $id_lo ; x value
srl $8, $id_lo, 6 ; y value
ldi $data, 0b0000011111111111 ; Default to red
mv $12, $0 ; shadow mask - mask is write only
ldc $13, 10 ; Offset from edges
sub $14, $14, $13 ; offset from opposite edges
; Draw left line of box
seq $10, $7, $13 ; equal
slt $11, $13, $8
and $10, $10, $11
slt $11, $8, $14
and $10, $10, $11
or $12, $12, $10
; Draw right line of box
seq $10, $7, $14 ; equal
slt $11, $13, $8
and $10, $10, $11
slt $11, $8, $14
and $10, $10, $11
or $12, $12, $10
; Draw upper line of box
seq $10, $8, $13 ; equal
slt $11, $13, $7 ; Check x-offset
and $10, $10, $11
slt $11, $7, $14 ; Check x-offset
and $10, $10, $11
or $12, $12, $10
; Draw lower line of box
seq $10, $8, $14 ; equal
slt $11, $13, $7 ; Check x-offset
and $10, $10, $11
slt $11, $7, $14 ; Check x-offset
and $10, $10, $11
or $12, $12, $10
; Next square
addi $14, $0, 64 ; width & height
ldc $13, 11 ; Offset from edges
sub $14, $14, $13 ; offset from opposite edges
; Draw left line of box
seq $10, $7, $13 ; equal
slt $11, $13, $8
and $10, $10, $11
slt $11, $8, $14
and $10, $10, $11
or $12, $12, $10
; Draw right line of box
seq $10, $7, $14 ; equal
slt $11, $13, $8
and $10, $10, $11
slt $11, $8, $14
and $10, $10, $11
or $12, $12, $10
; Draw upper line of box
seq $10, $8, $13 ; equal
slt $11, $13, $7 ; Check x-offset
and $10, $10, $11
slt $11, $7, $14 ; Check x-offset
and $10, $10, $11
or $12, $12, $10
; Draw lower line of box
seq $10, $8, $14 ; equal
slt $11, $13, $7 ; Check x-offset
and $10, $10, $11
slt $11, $7, $14 ; Check x-offset
and $10, $10, $11
or $12, $12, $10
; cross 1
seq $10, $7, $8 ; equal
or $12, $12, $10
; cross 2
addi $13, $0, 0b111111 ; 63 bitmask
sub $14, $13, $8 ; negative y value
seq $10, $14, $7 ; equal
or $12, $12, $10
mv $mask, $12 ; Store mask value
? ldi $data, 0xffff ; color, blue?
ldc $10, 5
add $address_lo, $10, $id_lo
sw