X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=ez.git;a=blobdiff_plain;f=ez.el;h=6e3b4bf37ecd1596869031c40ae43d8b583890d7;hp=181a37a444a5f70a8c410bc11a431652c92c2dbd;hb=52862ec1d857dc5591dcbda8715d60fecefee1b2;hpb=8455cb56b2ea86886949473c5e77175b9d713554 diff --git a/ez.el b/ez.el index 181a37a..6e3b4bf 100644 --- a/ez.el +++ b/ez.el @@ -504,6 +504,8 @@ ((1op #x0E) load ez-op-load) ((var #x01) storew ez-op-storew) ((2op #x0F) loadw ez-op-loadw) + ((var #x02) storeb ez-op-storeb) + ((2op #x10) loadb ez-op-loadb) ((2op #x01) je ez-op-je) ((2op #x08) or ez-op-or) ((2op #x09) and ez-op-and) @@ -520,7 +522,8 @@ ((var #x03) put_prop ez-op-put-prop) ((0op #x02) print ez-op-print) ((0op #x0B) new_line ez-op-new-line) - ((var #x06) print_num ez-op-print-num))) + ((var #x06) print_num ez-op-print-num) + ((var #x05) print_char ez-op-print-char))) (defun ez-op-ret (operands &optional operand-types) (let ((retval (car operands))) @@ -610,6 +613,19 @@ (ez-set-var (ez-read-pc-byte-and-inc) (ez-mem-ref-word (+ baddr (* 2 n))))) t) +(defun ez-op-storeb (operands operand-types) + (let ((baddr (car operands)) + (n (cadr operands)) + (a (caddr operands))) + (ez-mem-set-byte (+ baddr n) a)) + t) + +(defun ez-op-loadb (operands operand-types) + (let ((baddr (car operands)) + (n (cadr operands))) + (ez-set-var (ez-read-pc-byte-and-inc) (ez-mem-ref-byte (+ baddr n)))) + t) + (defun ez-op-and (operands operand-types) (let ((a (car operands)) (b (cadr operands))) @@ -708,6 +724,11 @@ (ez-print (number-to-string s))) t) +(defun ez-op-print-char (operands operand-types) + (let ((c (car operands))) + (ez-print (string c))) + t) + ;; Execution loop