File tree Expand file tree Collapse file tree 3 files changed +22
-6
lines changed Expand file tree Collapse file tree 3 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,23 @@ include "cores/select.cal"
22include "std/io.cal"
33
44func __uxn_exception begin
5- 65 printch new_line
5+ &_cal_exception Exception.msg + Array.length + @ printdec new_line
6+ &_cal_exception Exception.msg + Array.memberSize + @ printdec new_line
7+ &_cal_exception Exception.msg + Array.elements + @ printdec new_line
68 1 exit
79end
810
11+ func exception_msg begin
12+ &_cal_exception Exception.msg +
13+ end
14+
915func error foo begin
1016 c"hi im an exception" throw
1117end
1218
19+ #try foo
20+ #catch
21+ # exception_msg printstr new_line
22+ #end
23+
1324foo
Original file line number Diff line number Diff line change @@ -206,9 +206,14 @@ class BackendARM64 : CompilerBackend {
206206
207207 override string [] FinalCommands () {
208208 // TODO: allow user to specify commands manually?
209- bool isCross = executeShell(" which aarch64-linux-gnu-as" ).status == 0 ;
210- string assembler = isCross ? " aarch64-linux-gnu-as" : " as" ;
211- string linker = isCross ? " aarch64-linux-gnu-ld" : " ld" ;
209+ version (AArch64 ) {
210+ string assembler = " as" ;
211+ string linker = " ld" ;
212+ }
213+ else {
214+ string assembler = " aarch64-linux-gnu-as" ;
215+ string linker = " aarch64-linux-gnu-ld" ;
216+ }
212217
213218 string [] ret = [
214219 format(" mv %s %s.asm" , compiler.outFile, compiler.outFile),
Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ class BackendUXN : CompilerBackend {
300300 if (crash) {
301301 output ~= format(" ;global_%s LDA2\n " , Sanitise(" _cal_exception" ));
302302 output ~= " #0000 NEQ2\n " ;
303- output ~= format(" ;func__%s JCN \n " , Sanitise(" __uxn_exception" ));
303+ output ~= format(" ;func__%s JCN2 \n " , Sanitise(" __uxn_exception" ));
304304 }
305305 else {
306306 CompileReturn(node);
@@ -1108,7 +1108,7 @@ class BackendUXN : CompilerBackend {
11081108 foreach (i ; 0 .. 3 ) {
11091109 output ~= " DUP2 LDA2\n " ;
11101110 output ~= format(
1111- " ;global_%s #%.2x ADD2 STA2\n " , Sanitise(" _cal_exception" ), i + 1
1111+ " ;global_%s #%.2x ADD2 STA2\n " , Sanitise(" _cal_exception" ), i + 2
11121112 );
11131113 output ~= " #0002 ADD2\n " ;
11141114 }
You can’t perform that action at this time.
0 commit comments