diff options
author | Camil Staps | 2023-01-31 14:07:03 +0100 |
---|---|---|
committer | Camil Staps | 2023-01-31 14:07:03 +0100 |
commit | 4b7d499c3dbd5586aa855e54367d95930fd42a81 (patch) | |
tree | f4def722b898475cb191651b5cad0b5e69cd6f2f /driver.s | |
parent | Add compilation for symbols with arity 0 (diff) |
Minor improvements; implement saturated function and constructor applications
Diffstat (limited to 'driver.s')
-rw-r--r-- | driver.s | 28 |
1 files changed, 25 insertions, 3 deletions
@@ -1,11 +1,21 @@ .data + .align 2 +heap: + .space 0x80000 # 512KiB + .align 1 _cINT: .byte 0 # pointer arity .byte 1 # basic value arity .byte 0 # number of arguments that still have to be curried in + .align 1 +_cCHAR: + .byte 0 # pointer arity + .byte 1 # basic value arity + .byte 0 # number of arguments that still have to be curried in + .align 2 PRINTROOT: .word _nroot @@ -14,9 +24,6 @@ EVALROOT: .word _nroot .word 0 # to be filled in - .align 2 -heap: - .text main: la $gp,heap @@ -56,6 +63,8 @@ print_hnf: lw $t0,($s1) la $t1,_cINT beq $t0,$t1,print_int + la $t1,_cCHAR + beq $t0,$t1,print_char li $a0,'(' li $v0,11 # print_char syscall @@ -76,6 +85,19 @@ print_int: b print_rewind nop +print_char: + li $a0,39 # ' + li $v0,11 # print_char + syscall + lw $a0,4($s1) + li $v0,11 # print_char + syscall + li $a0,39 # ' + li $v0,11 # print_char + syscall + b print_rewind + nop + print_rewind: la $t5,PRINTROOT beq $s0,$t5,print_rewind_root |