about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-09-23 21:04:32 -0700
committerKartik Agaram <vc@akkartik.com>2018-09-23 21:04:32 -0700
commitc437c6dd904ce75bfbac85fa55b2567b4b8cff26 (patch)
tree1ea4f8a64b0340a96d98f7fd63ea76f82b22e23e /subx
parent20d9875459d2251694340e7bb5ca22cc07a817ff (diff)
downloadmu-c437c6dd904ce75bfbac85fa55b2567b4b8cff26.tar.gz
4509
Back to the Crenshaw compiler. Start by using string literals.
Diffstat (limited to 'subx')
-rw-r--r--subx/apps/crenshaw2-1.subx23
1 files changed, 4 insertions, 19 deletions
diff --git a/subx/apps/crenshaw2-1.subx b/subx/apps/crenshaw2-1.subx
index 48a6c16e..78ed60ec 100644
--- a/subx/apps/crenshaw2-1.subx
+++ b/subx/apps/crenshaw2-1.subx
@@ -19,9 +19,9 @@
 # 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes
 
 # main:
-  # abort(Error_integer)
+  # abort("Integer")
     # push args
-  68/push  Error_integer/imm32
+  68/push  "Integer"/imm32
     # call
   e8/call  abort/disp32
     # discard arg
@@ -50,7 +50,7 @@ abort:  # s : (address array byte) -> <void>
 error:  # s : (address array byte) -> <void>
   # write_stderr("Error: ")
     # push args
-  68/push  Error/imm32
+  68/push  "Error: "/imm32
     # call
   e8/call  write_stderr/disp32
     # discard arg
@@ -64,7 +64,7 @@ error:  # s : (address array byte) -> <void>
   81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               4/imm32           # add 4 to ESP
   # write_stderr(" expected")
     # push args
-  68/push  Expected_suffix/imm32
+  68/push  " expected"/imm32
     # call
   e8/call  write_stderr/disp32
     # discard arg
@@ -117,18 +117,3 @@ Newline:
   01 00 00 00
   # data
   0a/newline
-Error:  # "Error: " : (array byte)
-  # size
-  07 00 00 00
-  # data
-  45/E 72/r 72/r 6f/o 72/r 3a/: 20/space
-Expected_suffix:  # " expected" : (array byte)
-  # size
-  09 00 00 00
-  # data
-  20/space 65/e 78/x 70/p 65/e 63/c 74/t 65/e 64/d
-Error_integer:  # "Integer" : (array byte)
-  # size
-  07 00 00 00
-  # data
-  49/I 6e/n 74/t 65/e 67/g 65/e 72/r