-
Notifications
You must be signed in to change notification settings - Fork 0
/
EXA.exa
157 lines (150 loc) · 1.66 KB
/
EXA.exa
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
REPL GFX_BOOT
REPL WRITEFILE
REPL SINK
GRAB 400
MARK DECOMPRESS
COPY F X
TEST X = -9999
TJMP DECOMP_CHUNK_END
TEST X > 0
TJMP DECOMP_LONG
SUBI 0 X M
JUMP DECOMP_BYTE_END
MARK DECOMP_LONG
COPY X T
MARK DECOMP_LONG_LOOP
MODI T 10 M
DIVI T 10 T
TJMP DECOMP_LONG_LOOP
MARK DECOMP_BYTE_END
TEST EOF
FJMP DECOMPRESS
;GRAB THE NEXT FILE
FILE X
ADDI X 1 X
WIPE
GRAB X
JUMP DECOMPRESS
MARK DECOMP_CHUNK_END
COPY -9999 M
VOID M
REPL WRITEFILE
JUMP DECOMP_BYTE_END
MARK WRITEFILE
MAKE
;WE ASSUME FIRST INPUT
;IS NONTERMINATING
COPY M X
MARK WRITEFILE_LOOP
COPY X F
COPY M X
TEST X > -9999
TJMP WRITEFILE_LOOP
LINK 802
FILE M
HALT
MARK SINK
LINK 800
REPL SYNC
MODE
MARK SINK_WAIT
TEST MRD
FJMP SINK_WAIT
VOID M
JUMP SINK_WAIT
MARK SYNC
VOID M
VOID M
VOID M
VOID M
VOID M
VOID M
VOID M
VOID M
MODE
COPY 1 M
WAIT
COPY 0 M
WAIT
COPY 0 M
WAIT
MODE
JUMP SYNC
MARK GFX_BOOT
LINK 802
COPY M T
GRAB T
LINK -1
COPY 0 M
ADDI GX 10 GX
TEST GX = 80
TJMP GFX_FINISH_BOOT
REPL GFX_BOOT
SUBI GX 10 GX
DIVI GX 40 GY
MULI GY 10 GY
MODI GX 40 GX
;CENTER IMAGE
ADDI GX 35 GX
ADDI GY 35 GY
LINK 800
COPY 0 X
MODE
MARK GFX_BOOT_WAIT
TEST MRD
FJMP GFX_BOOT_WAIT
MODE
JUMP DRAW
MARK GFX_FINISH_BOOT
LINK 800
SUBI GX 10 GX
DIVI GX 40 GY
MULI GY 10 GY
MODI GX 40 GX
;CENTER IMAGE
ADDI GX 35 GX
ADDI GY 35 GY
COPY 0 X
MODE
COPY 0 M
MODE
JUMP DRAW
MARK GFX_SWAP
WIPE
LINK -1
MARK GFX
LINK 802
COPY M T
GRAB T
LINK -1
COPY 0 M
LINK 800
MARK DRAW
COPY F T
FJMP END
MARK LOOP
ADDI X 200 GP
ADDI X 1 X
SUBI T 1 T
TJMP LOOP
MARK END
ADDI X F X
TEST X > 99
FJMP EOF_TEST
MARK WAIT
COPY 0 M
MODE
MARK WAIT_WAIT
TEST MRD
FJMP WAIT_WAIT
MODE
WAIT
SUBI X 100 X
WAIT
WAIT
TEST X > 99
TJMP WAIT
MARK EOF_TEST
TEST EOF
TJMP GFX_SWAP
JUMP DRAW