ref: 7d392c61eb5272c97fbf6cff1b1b487662f9164f
parent: 4d596eb162c4f8bca66754a279d013c2edb4c274
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue Feb 18 06:42:56 EST 2025
fix disassembler
binary files a/boot/flisp.boot.builtin b/boot/flisp.boot.builtin differ
--- a/src/compiler.lsp
+++ b/src/compiler.lsp
@@ -97,15 +97,15 @@
(set! i (+ i 2)))
(begin
(io-write bcode
- (get Instructions
- (if long?
- (case vi
- (jmp 'jmp.l)
- (brne 'brne.l)
- (brnn 'brnn.l)
- (brn 'brn.l)
- (else vi))
- vi)))
+ (byte (get Instructions
+ (if long?
+ (case vi
+ (jmp 'jmp.l)
+ (brne 'brne.l)
+ (brnn 'brnn.l)
+ (brn 'brn.l)
+ (else vi))
+ vi))))
(set! i (+ i 1))
(set! nxt (and (< i n) (aref v i)))
(cond ((memq vi '(jmp brne brnn brn))
@@ -772,9 +772,9 @@
(def (print-inst inst s sz) (princ (if (and ip (= lev 0) (>= ip (1- s)) (< ip (+ s sz)))
" >"
" ")
- (hex5 (- s 5)) ": "
+ (hex5 (- s 1)) ": "
inst " "))
- (let ((i 4)
+ (let ((i 0)
(N (length code)))
(while (< i N)
; find key whose value matches the current byte
@@ -782,7 +782,7 @@
(or z (and (eq? v (aref code i))
k)))
nil Instructions)))
- (if (> i 4) (newline))
+ (if (> i 0) (newline))
(dotimes (xx lev) (princ "\t"))
(set! i (+ i 1))
(case inst
--- a/tools/gen.lsp
+++ b/tools/gen.lsp
@@ -126,7 +126,7 @@
builtins-doc)
(io-write builtins-doc "\n")))
docs)
- (put! e lop (byte i))
+ (put! e lop i)
(when argc
(put! cl cop (list lop argc))
(when (and (number? argc) (>= argc 0))