about summary refs log tree commit diff stats
path: root/apps
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-04-11 01:19:22 -0700
committerKartik Agaram <vc@akkartik.com>2020-05-18 00:44:46 -0700
commit27cced79be369784b0130c2cdc042c55c20ab593 (patch)
tree6cdf71a1252ed758d17d33e2977d7a223c88e017 /apps
parentf7360e493ac7e4d3fc27a1823db0ba62ef271433 (diff)
downloadmu-27cced79be369784b0130c2cdc042c55c20ab593.tar.gz
all syntax sugar now working
I just needed to adjust row-sizes when accessing the Registers table.

This commit dedicated to a fun hour on https://hn.town.siempre.io. Thanks
Cyrus!
(via https://news.ycombinator.com/item?id=22818300)
Diffstat (limited to 'apps')
-rwxr-xr-xapps/bracesbin42676 -> 45973 bytes
-rwxr-xr-xapps/callsbin47337 -> 50634 bytes
-rwxr-xr-xapps/sigilsbin55061 -> 58358 bytes
-rw-r--r--apps/sigils.subx48
4 files changed, 36 insertions, 12 deletions
diff --git a/apps/braces b/apps/braces
index 59a7abfd..a79cfb55 100755
--- a/apps/braces
+++ b/apps/braces
Binary files differdiff --git a/apps/calls b/apps/calls
index 815c1a3d..240972dd 100755
--- a/apps/calls
+++ b/apps/calls
Binary files differdiff --git a/apps/sigils b/apps/sigils
index 4879cb36..9f33941e 100755
--- a/apps/sigils
+++ b/apps/sigils
Binary files differdiff --git a/apps/sigils.subx b/apps/sigils.subx
index 93ca612a..fd973fab 100644
--- a/apps/sigils.subx
+++ b/apps/sigils.subx
@@ -1373,6 +1373,30 @@ emit-direct-mode:  # out: (addr buffered-file), word-slice: (addr slice)
     # ++local-slice->start to skip '%'
     # . ++(*eax)
     ff          0/subop/increment   0/mod/indirect  0/rm32/eax    .           .             .           .           .               .                 # increment *eax
+#?     # write-slice-buffered(Stderr, word-slice) {{{
+#?     # . . push args
+#?     50/push-eax
+#?     68/push  Stderr/imm32
+#?     # . . call
+#?     e8/call  write-slice-buffered/disp32
+#?     # . . discard args
+#?     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
+#?     # . flush(Stderr)
+#?     # . . push args
+#?     68/push  Stderr/imm32
+#?     # . . call
+#?     e8/call  flush/disp32
+#?     # . . discard args
+#?     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
+#?     # . write(2/stderr, "$\n")
+#?     # . . push args
+#?     68/push  "$\n"/imm32
+#?     68/push  2/imm32/stderr
+#?     # . . call
+#?     e8/call  write/disp32
+#?     # . . discard args
+#?     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
+#?     # }}}
     # local-slice = next-token-from-slice(local-slice->start, local-slice->end, "/")
     # . . push args
     50/push-eax
@@ -1383,10 +1407,10 @@ emit-direct-mode:  # out: (addr buffered-file), word-slice: (addr slice)
     e8/call  next-token-from-slice/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
-    # reg-num/eax = get-slice(Registers, local-slice, row-size=8)
+    # reg-num/eax = get-slice(Registers, local-slice, row-size=12)
     # . . push args
     68/push  "Registers"/imm32
-    68/push  8/imm32/row-size
+    68/push  0xc/imm32/row-size
     50/push-eax
     68/push  Registers/imm32
     # . . call
@@ -2214,7 +2238,7 @@ parse-effective-address:  # word-slice: (addr slice) -> base/eax, index/ecx, sca
     #   initialize defaults: base=0, index=4, scale=0, disp=0
     #   if (*local-slice->start != '(') {
     #     local-slice = next-token-from-slice(local-slice->start, local-slice->end, "/")
-    #     base = get-slice(Registers, local-slice, row-size=8)
+    #     base = get-slice(Registers, local-slice, row-size=12)
     #     return
     #   }
     #   # compound expressions
@@ -2281,11 +2305,11 @@ $parse-effective-address:simple-register:
     e8/call  next-token-from-slice/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
-    # base = get-slice(Registers, local-slice, row-size=8)
-    # . eax = get-slice(Registers, local-slice, row-size=8)
+    # base = get-slice(Registers, local-slice, row-size=12)
+    # . eax = get-slice(Registers, local-slice, row-size=12)
     # . . push args
     68/push  "Registers"/imm32
-    68/push  8/imm32/row-size
+    68/push  0xc/imm32/row-size
     56/push-esi
     68/push  Registers/imm32
     # . . call
@@ -2370,9 +2394,9 @@ $parse-effective-address:resolve-ambiguity:
     51/push-ecx
     # . . copy esp to ecx
     89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
-    # . eax = maybe-get-slice(Register, tmp, row-size=8)
+    # . eax = maybe-get-slice(Register, tmp, row-size=12)
     # . . push args
-    68/push  8/imm32/row-size
+    68/push  0xc/imm32/row-size
     51/push-ecx
     68/push  Registers/imm32
     # . . call
@@ -2687,10 +2711,10 @@ next-register:  # in: (addr slice) -> reg/eax: int
     89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
     # in->start += 3
     81          0/subop/add         0/mod/indirect  6/rm32/esi    .           .             .           .           .               3/imm32           # add to *esi
-    # eax = get-slice(Registers, reg-slice, row-size=8)
+    # eax = get-slice(Registers, reg-slice, row-size=12)
     # . . push args
     68/push  "next-register"/imm32
-    68/push  8/imm32/row-size
+    68/push  0xc/imm32/row-size
     51/push-ecx
     68/push  Registers/imm32
     # . . call
@@ -3889,9 +3913,9 @@ $disp32-mode?:check-for-register:
     e8/call  next-token-from-slice/disp32
     # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
-    # reg-num/eax = maybe-get-slice(Registers, local-slice, row-size=8)
+    # reg-num/eax = maybe-get-slice(Registers, local-slice, row-size=12)
     # . . push args
-    68/push  8/imm32/row-size
+    68/push  0xc/imm32/row-size
     56/push-esi
     68/push  Registers/imm32
     # . . cal