diff --git a/thun/asm-dump.txt b/thun/asm-dump.txt index 3aaa519..7ada828 100644 --- a/thun/asm-dump.txt +++ b/thun/asm-dump.txt @@ -5,7 +5,7 @@ label(A), mov_imm(0, 0), store_word(0, 0, 0), mov_imm(0, 4096), -mov_imm(1, B2), +mov_imm(1, Z1), mov_imm(2, 0), mov_imm(3, 0), store_word(2, 0, 0), @@ -233,57 +233,47 @@ eq_offset(Q1), sub(9, 9, 0), and_imm(9, 9, 32767), label(Q1), -sub_imm(6, 6, 0), -eq_offset(R1), -sub(6, 6, 0), -and_imm(6, 6, 32767), -label(R1), lsl_imm(9, 9, 15), ior(9, 9, 6), store_word(9, 0, 0), do_offset(H), +label(R1), +symbol(R1), +mov_imm(2, S1), +do_offset(U1), label(S1), -symbol(S1), -mov_imm(2, T1), -do_offset(V1), -label(T1), expr_cell(I1, 4), expr_cell(J, 0), -label(U1), -symbol(U1), -mov_imm(2, W1), -do_offset(V1), -label(W1), +label(T1), +symbol(T1), +mov_imm(2, V1), +do_offset(U1), +label(V1), expr_cell(R, 4), expr_cell(S, 0), +label(W1), +symbol(W1), +mov_imm(2, X1), +do_offset(U1), label(X1), -symbol(X1), -mov_imm(2, Y1), -do_offset(V1), -label(Y1), expr_cell(J1, 4), expr_cell(J, 0), -label(V1), +label(U1), mov_imm(7, 4), sub_imm(0, 0, 4), sub_imm(2, 2, 0), -eq_offset(Z1), +eq_offset(Y1), sub(2, 2, 0), and_imm(2, 2, 32767), -label(Z1), -sub_imm(7, 7, 0), -eq_offset(A2), -sub(7, 7, 0), -and_imm(7, 7, 32767), -label(A2), +label(Y1), lsl_imm(2, 2, 15), ior(2, 2, 7), store_word(2, 0, 0), mov_imm(7, S), add_imm(7, 7, 4), do(7), -label(B2), +label(Z1), expr_cell(I1, 4), expr_cell(R, 4), -expr_cell(X1, 4), +expr_cell(W1, 4), expr_cell(S, 0)]. \ No newline at end of file diff --git a/thun/compiler.markII.pl b/thun/compiler.markII.pl index 1dd61ab..ff0286c 100644 --- a/thun/compiler.markII.pl +++ b/thun/compiler.markII.pl @@ -165,7 +165,8 @@ Mark II sub_base_merge_and_store(TEMP0, TEMP4, SP), % Push first item onto stack. asm(mov_imm(TEMP0, 4)), % Used for linking to previous cell. incr(SP), - sub_base_merge_and_store(TEMP3, TEMP0, SP), % Push first item onto stack. + sub_base_from_offset(TEMP3, SP), + merge_and_store(TEMP3, TEMP0, SP), % Push second item onto stack. jump(Main), definition(Unit, [New, Cons], DoDef, TOS), @@ -175,7 +176,8 @@ Mark II label(DoDef), % TOS points to body expr, set by definition. asm(mov_imm(TEMP1, 4)), % Used for linking to previous cell. incr(SP), - sub_base_merge_and_store(TOS, TEMP1, SP), % Push body expr onto stack. + sub_base_from_offset(TOS, SP), + merge_and_store(TOS, TEMP1, SP), % Push body expr onto stack. asm(mov_imm(TEMP1, I)), % Get address of I's machine code. asm(add_imm(TEMP1, TEMP1, 4)), asm(do(TEMP1)), diff --git a/thun/joy_asmii.bin b/thun/joy_asmii.bin index 9e6a2a1..52a61c2 100644 Binary files a/thun/joy_asmii.bin and b/thun/joy_asmii.bin differ