Some more compile time errors, some bug fixes for runtime
This commit is contained in:
parent
274376a5de
commit
33f1618915
@ -31,7 +31,7 @@ alloc-do-gc
|
|||||||
(drop)
|
(drop)
|
||||||
(drop)
|
(drop)
|
||||||
;; Run garbage collection
|
;; Run garbage collection
|
||||||
(push gc-start)
|
(push gc-run)
|
||||||
(call)
|
(call)
|
||||||
;; Tail-call allocation
|
;; Tail-call allocation
|
||||||
(push alloc)
|
(push alloc)
|
||||||
@ -123,6 +123,19 @@ reg-relocated
|
|||||||
(drop)
|
(drop)
|
||||||
(return)
|
(return)
|
||||||
|
|
||||||
|
gc-loop
|
||||||
|
(ref free)
|
||||||
|
(ref scan)
|
||||||
|
(<)
|
||||||
|
(branch gc-loop-done)
|
||||||
|
(ref scan)
|
||||||
|
(relocate-reg)
|
||||||
|
(push gc-loop)
|
||||||
|
(jmp)
|
||||||
|
gc-loop-done
|
||||||
|
(return)
|
||||||
|
|
||||||
|
|
||||||
main
|
main
|
||||||
;; These need to be initialized with the runtime
|
;; These need to be initialized with the runtime
|
||||||
(push memory)
|
(push memory)
|
||||||
|
@ -76,7 +76,10 @@
|
|||||||
(when (eq? (car inst) 'push)
|
(when (eq? (car inst) 'push)
|
||||||
(if (number? (cadr inst))
|
(if (number? (cadr inst))
|
||||||
(write-word (cadr inst))
|
(write-word (cadr inst))
|
||||||
(write-word (assq-ref labels (cadr inst)))))
|
(let ([address (assq-ref labels (cadr inst))])
|
||||||
|
(if address
|
||||||
|
(write-word (assq-ref labels (cadr inst)))
|
||||||
|
(error (format #f "Could not find label ~a" (cadr inst)))))))
|
||||||
(assembly-pass (cdr seq) labels))]))
|
(assembly-pass (cdr seq) labels))]))
|
||||||
|
|
||||||
(define (assemble instructions port)
|
(define (assemble instructions port)
|
||||||
|
Loading…
Reference in New Issue
Block a user