-
Notifications
You must be signed in to change notification settings - Fork 5
/
XA.exa
164 lines (125 loc) · 1.56 KB
/
XA.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
158
159
160
161
162
163
164
; FIRST ATTEMPTS WERE
; BAD, BUT IM HAPPY
; WITH THIS ONE
;
;
; BROADCASTER SEND DNA
; GLOBALLY
;
; OVERWRITER RECEIVE DNA
; GLOBALLY
;
; BROAD/OVERW MAKE COPY
; OF DNA IN REPL
MARK START
GRAB 300
FJMP SKIP_SEEK
SEEK 1
MARK SKIP_SEEK
COPY F X
DROP
LINK 800
LINK 801
GRAB 200
MARK FIND_NAME
TEST F = X
TJMP FOUND_NAME
SEEK 10
JUMP FIND_NAME
MARK FILE_COPIER
MAKE
@REP 10
COPY M F
@END
FILE X
COPY X M
HALT
MARK KILL
WIPE
LINK -1
KILL
HALT
MARK FOUND_NAME
REPL FILE_COPIER
MARK LOOP_LOCAL_SEND
@REP 10
COPY F M
@END
DROP
COPY M X
GRAB X
TEST X = 400 ; FIRST
TJMP BROADCASTER_START
TEST X > 401 ; DNA SEND
TJMP BROADCASTER_DNA
; **********************
; OVERWRITER START *****
LINK -1
COPY 1 M
LINK -1
; WAIT LOCAL
MARK WAIT_OVERWRITER
VOID M
; COPY FILE TO X -> REPL
MARK DUPE_OVERWRITER
COPY F X
REPL OVERWRITER_DUPE
JUMP WAIT_OVERWRITER
MARK OVERWRITER_DUPE
MODE ; <- GLOBAL
LINK 800
SWIZ X 3 T
ADDI 800 T T
LINK T
SWIZ X 2 T
ADDI 200 T T
GRAB T
SWIZ X 1 T
MULI T 10 X
SEEK X
@REP 10
COPY M F
@END
HALT
; *********************
; BROADCASTER START ****
MARK BROADCASTER_START
; REPL FOR OVERWRITER
LINK -1
LINK -1
REPL START
LINK 800
; WAIT LOCAL
MARK WAIT_BROADCASTER
VOID M
; COPY FILE TO X -> REPL
TEST EOF
TJMP KILL
COPY F X
REPL BROADCASTER_DUPE
JUMP WAIT_BROADCASTER
MARK BROADCASTER_DUPE
SWIZ X 3 T
ADDI 800 T T
LINK T
SWIZ X 2 T
ADDI 200 T T
GRAB T
SWIZ X 1 T
MULI T 10 X
SEEK X
COPY 10 T
REPL FILE_COPIER
JUMP LOOP_LOCAL_SEND
MARK BROADCASTER_DNA
LINK -1
LINK -1
COPY 1 M
MODE ; <- GLOBAL
@REP 10
COPY F M
@END
MODE ; <- LOCAL
LINK 800
COPY 1 M
WIPE