Add driver

This commit is contained in:
2025-01-09 14:26:22 -06:00
parent f8a868bb23
commit 422c675981
2 changed files with 41 additions and 2 deletions

View File

@@ -8,7 +8,7 @@
*instruction-set* instruction-type instruction-code))
;;; Data Structures
(define *stack-size* 1000)
(define *stack-size* 512)
(define *memory-size* 2048)
(define* (make-stack #:optional (stack-size *stack-size*))
@@ -79,7 +79,7 @@
(let ([bv (read-bytevector 4)])
(bytevector-s32-ref bv 0 (native-endianness))))
;;; Program execution
;;; Instructions
(define *instruction-set*
'((push #x01 i)
(pop #x02 o)
@@ -126,6 +126,8 @@
[(<) <]
[(=) =]))
;;; Execution
(define (jump addr)
(seek (current-input-port) addr SEEK_SET))