File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ class BackendUXN : CompilerBackend {
148
148
output ~= " |100\n " ;
149
149
output ~= " @on-reset\n " ;
150
150
output ~= " #ffff .vsp STZ2\n " ;
151
- output ~= " calmain \n " ;
151
+ output ~= " init \n " ;
152
152
output ~= " BRK\n " ;
153
153
}
154
154
@@ -161,6 +161,21 @@ class BackendUXN : CompilerBackend {
161
161
}
162
162
}
163
163
164
+ if (" __uxn_program_exit" in words) {
165
+ CallFunction(" __uxn_program_exit" );
166
+ }
167
+ else {
168
+ WarnNoInfo(" No exit function available, expect bugs" );
169
+ }
170
+
171
+ // create init function
172
+ output ~= " @init\n " ;
173
+ if (" __uxn_program_init" in words) {
174
+ CallFunction(" __uxn_program_init" );
175
+ }
176
+ else {
177
+ WarnNoInfo(" No program init function available" );
178
+ }
164
179
output ~= " JMP2r\n " ;
165
180
166
181
foreach (var ; globals) {
@@ -199,6 +214,8 @@ class BackendUXN : CompilerBackend {
199
214
output ~= " &dstBank 0000\n " ;
200
215
output ~= " &dstAddr 0000\n " ;
201
216
217
+ output ~= " @program_end\n " ;
218
+
202
219
// pad for the stack
203
220
output ~= " |e0000\n " ;
204
221
}
You can’t perform that action at this time.
0 commit comments