The Lambda Lab
/
projects
/
ez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9ac00a5
)
Fixed local variable numbering bug.
author
Tim Vaughan
<timv@ughan.xyz>
Fri, 15 Oct 2021 07:17:28 +0000
(09:17 +0200)
committer
Tim Vaughan
<timv@ughan.xyz>
Fri, 15 Oct 2021 07:17:28 +0000
(09:17 +0200)
ez.el
patch
|
blob
|
history
diff --git
a/ez.el
b/ez.el
index
4cea075
..
b766b70
100644
(file)
--- a/
ez.el
+++ b/
ez.el
@@
-236,7
+236,7
@@
((= var 0)
(ez-routine-stack-pop))
((< var 16)
((= var 0)
(ez-routine-stack-pop))
((< var 16)
- (ez-get-local-var
(- var 1)
))
+ (ez-get-local-var
var
))
(t
(ez-get-global-var (- var 16)))))
(t
(ez-get-global-var (- var 16)))))
@@
-245,7
+245,7
@@
((= var 0)
(ez-routine-stack-push val))
((< var 16)
((= var 0)
(ez-routine-stack-push val))
((< var 16)
- (ez-set-local-var
(- var 1)
val))
+ (ez-set-local-var
var
val))
(t
(ez-set-global-var (- var 16) val))))
(t
(ez-set-global-var (- var 16) val))))
@@
-303,9
+303,8
@@
(unless table-row
(error "Unsupported op" optype opcode))
(let ((mnemonic (elt table-row 1)))
(unless table-row
(error "Unsupported op" optype opcode))
(let ((mnemonic (elt table-row 1)))
- (message "Optype:%s Opcode:%x Operands:%s"
- (symbol-name optype)
- opcode operands))
+ (message "Optype:%s Opcode:%x Mnemonic:%s Operands:%s"
+ optype opcode mnemonic operands))
(apply (elt table-row 2) operands))))
(defun ez-read-var-operands-and-inc ()
(apply (elt table-row 2) operands))))
(defun ez-read-var-operands-and-inc ()
@@
-348,7
+347,7
@@
(dotimes (i L)
(if (< i n)
(ez-set-local-var (+ i 1) (elt operands i))
(dotimes (i L)
(if (< i n)
(ez-set-local-var (+ i 1) (elt operands i))
- (ez-set-local-var (+ i 1) (ez-mem-ref-
byte
(+ r 1 (* 2 i)))))))
+ (ez-set-local-var (+ i 1) (ez-mem-ref-
word
(+ r 1 (* 2 i)))))))
t)
;; Main
t)
;; Main
@@
-366,26
+365,8
@@
(ez-parse-header)
(setq ez-call-stack (list (ez-make-call-stack-frame ez-start-pc)))
(ez-execute-instr)
(ez-parse-header)
(setq ez-call-stack (list (ez-make-call-stack-frame ez-start-pc)))
(ez-execute-instr)
-
-(binformat #x9b)
-"10 01 10 11"
-
-(* 2 #x2b07)
-
-"10011011"
-
-#b00101111
-(lsh #x2f)
-
ez-call-stack
ez-call-stack
-(binformat #x2f)
-"10 11 11"
-(* 2 #x2b07)
-
-
-(ez-get-obj 1)
-
(defun binformat (n &optional s)
(unless s
(setq s ""))
(defun binformat (n &optional s)
(unless s
(setq s ""))