Skip to content

Commit a41c8a7

Browse files
committed
uxn org stuff
1 parent ba427e1 commit a41c8a7

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

source/app.d

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ int main(string[] args) {
7878

7979
string file;
8080
string outFile = "out";
81-
ulong org = 0xFFFF;
8281
bool orgSet;
8382
string[] includeDirs;
8483
bool optimise;
@@ -137,7 +136,7 @@ int main(string[] args) {
137136
}
138137

139138
try {
140-
org = args[i].to!ulong(16);
139+
backend.org = args[i].to!ulong(16);
141140
}
142141
catch (ConvException) {
143142
stderr.writeln("--org parameter must be hexadecimal");
@@ -377,7 +376,6 @@ int main(string[] args) {
377376

378377
auto compiler = new Compiler();
379378
compiler.backend = backend;
380-
compiler.backend.org = org;
381379
compiler.backend.orgSet = orgSet;
382380
compiler.backend.useDebug = doDebug;
383381
compiler.backend.exportSymbols = exportSymbols;

source/backends/uxn.d

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class BackendUXN : CompilerBackend {
3333
string assembler = "uxnasm";
3434

3535
this() {
36+
org = 0x100;
3637
output = new Output();
3738

3839
addrSize = 2;
@@ -163,7 +164,7 @@ class BackendUXN : CompilerBackend {
163164

164165
override void Init() {
165166
output ~= "|0 @vsp $2 @arraySrc $2 @arrayDest $2 @temp $2\n";
166-
output ~= "|100\n";
167+
output ~= format("|%x\n", org);
167168
output ~= "@on-reset\n";
168169
output ~= " #ffff .vsp STZ2\n";
169170
output ~= " init\n";

source/codeRemover.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class CodeRemover {
2525
"uxn_program_init",
2626
"uxn_program_end",
2727
"__uxn_program_init",
28-
"__uxn_program_end",
28+
"__uxn_program_exit",
2929
"__x86_64_exception",
3030
"__rm86_exception",
3131
"__uxn_exception",

0 commit comments

Comments
 (0)