From c437c6dd904ce75bfbac85fa55b2567b4b8cff26 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 23 Sep 2018 21:04:32 -0700 Subject: 4509 Back to the Crenshaw compiler. Start by using string literals. --- subx/apps/crenshaw2-1.subx | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'subx') 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) -> error: # s : (address array byte) -> # 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) -> 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 -- cgit 1.4.1-2-gfad0