Skip to content

Commit

Permalink
Merged: Add uxn target
Browse files Browse the repository at this point in the history
Add uxn target
  • Loading branch information
yeti0904 authored Jun 5, 2024
2 parents 060070c + b0b2649 commit 9a8160c
Show file tree
Hide file tree
Showing 10 changed files with 656 additions and 10 deletions.
5 changes: 0 additions & 5 deletions examples/countTo10.cal
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
include "cores/select.cal"
include "std/io.cal"

func new_line begin
13 printch
10 printch
end

let cell i
0 i !

Expand Down
1 change: 0 additions & 1 deletion examples/sierpinski.cal
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include "cores/select.cal"
include "std/io.cal"

func sierpinski begin
let cell n
Expand Down
1 change: 0 additions & 1 deletion examples/stars.cal
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include "cores/select.cal"
include "std/io.cal"

let cell x 0 x !
let cell y 0 y !
Expand Down
6 changes: 6 additions & 0 deletions source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import callisto.compiler;
import callisto.language;
import callisto.optimiser;
import callisto.preprocessor;
import callisto.backends.uxn;
import callisto.backends.y32;
import callisto.backends.rm86;
import callisto.backends.linux86;
Expand Down Expand Up @@ -39,6 +40,7 @@ Backends:
rm86 - Real mode x86 and MS-DOS
linux86 - Linux for 64-bit x86
y32 - YETI-32
uxn - Varvara/Uxn
";

int main(string[] args) {
Expand Down Expand Up @@ -147,6 +149,10 @@ int main(string[] args) {
backend = new BackendY32();
break;
}
case "uxn": {
backend = new BackendUXN();
break;
}
default: {
stderr.writefln("Unknown backend '%s'", args[i]);
return 1;
Expand Down
2 changes: 2 additions & 0 deletions source/backends/linux86.d
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ class BackendLinux86 : CompilerBackend {
return ret ~ format("rm %s.asm %s.o", compiler.outFile, compiler.outFile);
}

override long MaxInt() => -1;

override void BeginMain() {
output ~= "__calmain:\n";
}
Expand Down
2 changes: 2 additions & 0 deletions source/backends/rm86.d
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ class BackendRM86 : CompilerBackend {
format("rm %s.asm", compiler.outFile)
];

override long MaxInt() => 0xFFFF;

override void BeginMain() {
output ~= "__calmain:\n";
}
Expand Down
Loading

0 comments on commit 9a8160c

Please sign in to comment.