From 2655a4a91d1d2e98cc9ab9c54e70d4eb49c735d6 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 30 Jun 2020 14:54:30 -0700 Subject: [PATCH] 6602 --- apps/arith.mu | 2 +- html/066write-int-hex.subx.html | 78 +++++++------- html/067parse-hex.subx.html | 4 +- html/068error-byte.subx.html | 4 +- html/069allocate.subx.html | 4 +- html/070new-stream.subx.html | 4 +- html/075write-int-decimal.subx.html | 153 ++++++++++++++++++-------- html/078emit-hex.subx.html | 4 +- html/091write-int.subx.html | 2 +- html/103screen.subx.html | 58 +++++----- html/104keyboard.subx.html | 8 +- html/106size.subx.html | 77 +++++++++++++ html/apps/arith.mu.html | 26 ++--- html/apps/braces.subx.html | 8 +- html/apps/browse.mu.html | 22 ++-- html/apps/calls.subx.html | 6 +- html/apps/dquotes.subx.html | 14 +-- html/apps/ex1.mu.html | 6 +- html/apps/ex2.mu.html | 10 +- html/apps/ex3.2.mu.html | 20 ++-- html/apps/factorial.subx.html | 4 +- html/apps/mu.subx.html | 162 ++++++++++++++-------------- html/apps/parse-int.mu.html | 4 +- html/apps/print-file.mu.html | 6 +- html/apps/random.subx.html | 4 +- html/apps/sigils.subx.html | 52 ++++----- html/apps/subx-params.subx.html | 4 +- html/apps/survey.subx.html | 22 ++-- html/apps/tui.mu.html | 30 +++--- 29 files changed, 469 insertions(+), 329 deletions(-) create mode 100644 html/106size.subx.html diff --git a/apps/arith.mu b/apps/arith.mu index 4f33d7be..23b078fe 100644 --- a/apps/arith.mu +++ b/apps/arith.mu @@ -56,7 +56,7 @@ fn main -> exit-status/ebx: int { fn simplify -> result/eax: int, look/esi: byte { # prime the pump - look <- get-char # prime the pump + look <- get-char # do it result, look <- expression look } diff --git a/html/066write-int-hex.subx.html b/html/066write-int-hex.subx.html index dac46129..0a68e432 100644 --- a/html/066write-int-hex.subx.html +++ b/html/066write-int-hex.subx.html @@ -2,7 +2,7 @@ -Mu - 066print-int.subx +Mu - 066write-int-hex.subx @@ -57,9 +57,9 @@ if ('onhashchange' in window) { -https://github.com/akkartik/mu/blob/master/066print-int.subx +https://github.com/akkartik/mu/blob/master/066write-int-hex.subx
-  1 # Print the (hex) textual representation of numbers.
+  1 # Write out the (hex) textual representation of numbers.
   2 
   3 == code
   4 #   instruction                     effective address                                                   register    displacement    immediate
@@ -90,7 +90,7 @@ if ('onhashchange' in window) {
  29     c1/shift    5/subop/logic-right 3/mod/direct    0/rm32/eax    .           .             .           .           .               4/imm8            # shift eax right by 4 bits, while padding zeroes
  30     25/and-eax  0xf/imm32
  31     # . AL = to-hex-char(AL)
- 32     e8/call  to-hex-char/disp32
+ 32     e8/call  to-hex-char/disp32
  33     # append-byte(f, AL)
  34     # . . push args
  35     50/push-eax
@@ -103,7 +103,7 @@ if ('onhashchange' in window) {
  42     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           0/r32/eax   0xc/disp8       .                 # copy *(ebp+12) to eax
  43     25/and-eax  0xf/imm32
  44     # . AL = to-hex-char(AL)
- 45     e8/call  to-hex-char/disp32
+ 45     e8/call  to-hex-char/disp32
  46     # append-byte(f, AL)
  47     # . . push args
  48     50/push-eax
@@ -135,7 +135,7 @@ if ('onhashchange' in window) {
  74     68/push  0xa/imm32
  75     68/push  _test-stream/imm32
  76     # . . call
- 77     e8/call  append-byte-hex/disp32
+ 77     e8/call  append-byte-hex/disp32
  78     # . . discard args
  79     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
  80     # check-stream-equal(_test-stream, "0a", msg)
@@ -151,7 +151,7 @@ if ('onhashchange' in window) {
  90     c3/return
  91 
  92 # print the hex representation for the lowest byte of a number
- 93 print-byte-buffered:  # f: (addr buffered-file), n: int
+ 93 write-byte-hex-buffered:  # f: (addr buffered-file), n: int
  94     # . prologue
  95     55/push-ebp
  96     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
@@ -162,7 +162,7 @@ if ('onhashchange' in window) {
 101     c1/shift    5/subop/logic-right 3/mod/direct    0/rm32/eax    .           .             .           .           .               4/imm8            # shift eax right by 4 bits, while padding zeroes
 102     25/and-eax  0xf/imm32
 103     # . AL = to-hex-char(AL)
-104     e8/call  to-hex-char/disp32
+104     e8/call  to-hex-char/disp32
 105     # write-byte-buffered(f, AL)
 106     # . . push args
 107     50/push-eax
@@ -175,7 +175,7 @@ if ('onhashchange' in window) {
 114     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           0/r32/eax   0xc/disp8       .                 # copy *(ebp+12) to eax
 115     25/and-eax  0xf/imm32
 116     # . AL = to-hex-char(AL)
-117     e8/call  to-hex-char/disp32
+117     e8/call  to-hex-char/disp32
 118     # write-byte-buffered(f, AL)
 119     # . . push args
 120     50/push-eax
@@ -184,7 +184,7 @@ if ('onhashchange' in window) {
 123     e8/call  write-byte-buffered/disp32
 124     # . . discard args
 125     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
-126 $print-byte-buffered:end:
+126 $write-byte-hex-buffered:end:
 127     # . restore registers
 128     58/pop-to-eax
 129     # . epilogue
@@ -192,8 +192,8 @@ if ('onhashchange' in window) {
 131     5d/pop-to-ebp
 132     c3/return
 133 
-134 test-print-byte-buffered:
-135     # - check that print-byte-buffered prints the hex textual representation
+134 test-write-byte-hex-buffered:
+135     # - check that write-byte-hex-buffered prints the hex textual representation
 136     # setup
 137     # . clear-stream(_test-stream)
 138     # . . push args
@@ -209,12 +209,12 @@ if ('onhashchange' in window) {
 148     e8/call  clear-stream/disp32
 149     # . . discard args
 150     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
-151     # print-byte-buffered(_test-buffered-file, 0xa)  # exercises digit, non-digit as well as leading zero
+151     # write-byte-hex-buffered(_test-buffered-file, 0xa)  # exercises digit, non-digit as well as leading zero
 152     # . . push args
 153     68/push  0xa/imm32
 154     68/push  _test-buffered-file/imm32
 155     # . . call
-156     e8/call  print-byte-buffered/disp32
+156     e8/call  write-byte-hex-buffered/disp32
 157     # . . discard args
 158     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 159     # flush(_test-buffered-file)
@@ -226,7 +226,7 @@ if ('onhashchange' in window) {
 165     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 166     # check-stream-equal(_test-stream, "0a", msg)
 167     # . . push args
-168     68/push  "F - test-print-byte-buffered"/imm32
+168     68/push  "F - test-write-byte-hex-buffered"/imm32
 169     68/push  "0a"/imm32
 170     68/push  _test-stream/imm32
 171     # . . call
@@ -236,7 +236,7 @@ if ('onhashchange' in window) {
 175     # . end
 176     c3/return
 177 
-178 print-int32:  # f: (addr stream byte), n: int
+178 write-int32-hex:  # f: (addr stream byte), n: int
 179     # pseudocode:
 180     #  write(f, "0x")
 181     #  ecx = 28
@@ -255,7 +255,7 @@ if ('onhashchange' in window) {
 194     51/push-ecx
 195     # ecx = 28
 196     b9/copy-to-ecx  0x1c/imm32
-197 $print-int32:print-hex-prefix:
+197 $write-int32-hex:hex-prefix:
 198     # write(f, "0x")
 199     # . . push args
 200     68/push  "0x"/imm32
@@ -264,16 +264,16 @@ if ('onhashchange' in window) {
 203     e8/call  write/disp32
 204     # . . discard args
 205     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
-206 $print-int32:loop:
+206 $write-int32-hex:loop:
 207     # if (ecx < 0) break
 208     81          7/subop/compare     3/mod/direct    1/rm32/ecx    .           .             .           .           .               0/imm32           # compare ecx
-209     7c/jump-if-<  $print-int32:end/disp8
+209     7c/jump-if-<  $write-int32-hex:end/disp8
 210     # eax = n >> ecx
 211     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           0/r32/eax   0xc/disp8       .                 # copy *(ebp+12) to eax
 212     d3/>>ecx    5/subop/pad-zeroes  3/mod/direct    0/rm32/eax    .           .             .           .           .               .                 # shift eax right by ecx bits, padding zeroes
 213     # eax = to-hex-char(AL)
 214     25/and-eax  0xf/imm32
-215     e8/call  to-hex-char/disp32
+215     e8/call  to-hex-char/disp32
 216     # append-byte(f, AL)
 217     # . . push args
 218     50/push-eax
@@ -284,8 +284,8 @@ if ('onhashchange' in window) {
 223     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 224     # ecx -= 4
 225     81          5/subop/subtract    3/mod/direct    1/rm32/ecx    .           .             .           .           .               4/imm32           # subtract from ecx
-226     eb/jump  $print-int32:loop/disp8
-227 $print-int32:end:
+226     eb/jump  $write-int32-hex:loop/disp8
+227 $write-int32-hex:end:
 228     # . restore registers
 229     59/pop-to-ecx
 230     58/pop-to-eax
@@ -294,8 +294,8 @@ if ('onhashchange' in window) {
 233     5d/pop-to-ebp
 234     c3/return
 235 
-236 test-print-int32:
-237     # - check that print-int32 prints the hex textual representation
+236 test-write-int32-hex:
+237     # - check that write-int32-hex prints the hex textual representation
 238     # setup
 239     # . clear-stream(_test-stream)
 240     # . . push args
@@ -304,17 +304,17 @@ if ('onhashchange' in window) {
 243     e8/call  clear-stream/disp32
 244     # . . discard args
 245     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
-246     # print-int32(_test-stream, 0x8899aa)
+246     # write-int32-hex(_test-stream, 0x8899aa)
 247     # . . push args
 248     68/push  0x8899aa/imm32
 249     68/push  _test-stream/imm32
 250     # . . call
-251     e8/call  print-int32/disp32
+251     e8/call  write-int32-hex/disp32
 252     # . . discard args
 253     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 254     # check-stream-equal(_test-stream, "0x008899aa", msg)
 255     # . . push args
-256     68/push  "F - test-print-int32"/imm32
+256     68/push  "F - test-write-int32-hex"/imm32
 257     68/push  "0x008899aa"/imm32
 258     68/push  _test-stream/imm32
 259     # . . call
@@ -324,7 +324,7 @@ if ('onhashchange' in window) {
 263     # . end
 264     c3/return
 265 
-266 print-int32-buffered:  # f: (addr buffered-file), n: int
+266 write-int32-hex-buffered:  # f: (addr buffered-file), n: int
 267     # pseudocode:
 268     #  write-buffered(f, "0x")
 269     #  ecx = 28
@@ -343,7 +343,7 @@ if ('onhashchange' in window) {
 282     51/push-ecx
 283     # ecx = 28
 284     b9/copy-to-ecx  0x1c/imm32
-285 $print-int32-buffered:print-hex-prefix:
+285 $write-int32-hex-buffered:hex-prefix:
 286     # write-buffered(f, "0x")
 287     # . . push args
 288     68/push  "0x"/imm32
@@ -352,16 +352,16 @@ if ('onhashchange' in window) {
 291     e8/call  write-buffered/disp32
 292     # . . discard args
 293     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
-294 $print-int32-buffered:loop:
+294 $write-int32-hex-buffered:loop:
 295     # if (ecx < 0) break
 296     81          7/subop/compare     3/mod/direct    1/rm32/ecx    .           .             .           .           .               0/imm32           # compare ecx
-297     7c/jump-if-<  $print-int32-buffered:end/disp8
+297     7c/jump-if-<  $write-int32-hex-buffered:end/disp8
 298     # eax = n >> ecx
 299     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           0/r32/eax   0xc/disp8       .                 # copy *(ebp+12) to eax
 300     d3/>>ecx    5/subop/pad-zeroes  3/mod/direct    0/rm32/eax    .           .             .           .           .               .                 # shift eax right by ecx bits, padding zeroes
 301     # eax = to-hex-char(AL)
 302     25/and-eax  0xf/imm32
-303     e8/call  to-hex-char/disp32
+303     e8/call  to-hex-char/disp32
 304     # write-byte-buffered(f, AL)
 305     # . . push args
 306     50/push-eax
@@ -372,8 +372,8 @@ if ('onhashchange' in window) {
 311     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 312     # ecx -= 4
 313     81          5/subop/subtract    3/mod/direct    1/rm32/ecx    .           .             .           .           .               4/imm32           # subtract from ecx
-314     eb/jump  $print-int32-buffered:loop/disp8
-315 $print-int32-buffered:end:
+314     eb/jump  $write-int32-hex-buffered:loop/disp8
+315 $write-int32-hex-buffered:end:
 316     # . restore registers
 317     59/pop-to-ecx
 318     58/pop-to-eax
@@ -382,8 +382,8 @@ if ('onhashchange' in window) {
 321     5d/pop-to-ebp
 322     c3/return
 323 
-324 test-print-int32-buffered:
-325     # - check that print-int32-buffered prints the hex textual representation
+324 test-write-int32-hex-buffered:
+325     # - check that write-int32-hex-buffered prints the hex textual representation
 326     # setup
 327     # . clear-stream(_test-stream)
 328     # . . push args
@@ -399,12 +399,12 @@ if ('onhashchange' in window) {
 338     e8/call  clear-stream/disp32
 339     # . . discard args
 340     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
-341     # print-int32-buffered(_test-buffered-file, 0x8899aa)
+341     # write-int32-hex-buffered(_test-buffered-file, 0x8899aa)
 342     # . . push args
 343     68/push  0x8899aa/imm32
 344     68/push  _test-buffered-file/imm32
 345     # . . call
-346     e8/call  print-int32-buffered/disp32
+346     e8/call  write-int32-hex-buffered/disp32
 347     # . . discard args
 348     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 349     # flush(_test-buffered-file)
@@ -417,7 +417,7 @@ if ('onhashchange' in window) {
 356 +-- 18 lines: #?     # dump line --------------------------------------------------------------------------------------------------------------------------------------------------------
 374     # check-stream-equal(_test-stream, "0x008899aa", msg)
 375     # . . push args
-376     68/push  "F - test-print-int32-buffered"/imm32
+376     68/push  "F - test-write-int32-hex-buffered"/imm32
 377     68/push  "0x008899aa"/imm32
 378     68/push  _test-stream/imm32
 379     # . . call
diff --git a/html/067parse-hex.subx.html b/html/067parse-hex.subx.html
index b8aa4eb2..73cc6428 100644
--- a/html/067parse-hex.subx.html
+++ b/html/067parse-hex.subx.html
@@ -967,12 +967,12 @@ if ('onhashchange' in window) {
 907     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 908     # . . restore eax
 909     58/pop-to-eax
-910     # . print-int32-buffered(Stderr, eax)
+910     # . write-int32-hex-buffered(Stderr, eax)
 911     # . . push args
 912     50/push-eax
 913     68/push  Stderr/imm32
 914     # . . call
-915     e8/call  print-int32-buffered/disp32
+915     e8/call  write-int32-hex-buffered/disp32
 916     # . . discard args
 917     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 918     # . flush(Stderr)
diff --git a/html/068error-byte.subx.html b/html/068error-byte.subx.html
index 8a4275ca..b726153f 100644
--- a/html/068error-byte.subx.html
+++ b/html/068error-byte.subx.html
@@ -111,12 +111,12 @@ if ('onhashchange' in window) {
 51     e8/call  write-buffered/disp32
 52     # . . discard args
 53     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
-54     # print-byte-buffered(out, byte)
+54     # write-byte-hex-buffered(out, byte)
 55     # . . push args
 56     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0x14/disp8      .                 # push *(ebp+20)
 57     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       .                 # push *(ebp+12)
 58     # . . call
-59     e8/call  print-byte-buffered/disp32
+59     e8/call  write-byte-hex-buffered/disp32
 60     # . . discard args
 61     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 62     # write-buffered(out, Newline)
diff --git a/html/069allocate.subx.html b/html/069allocate.subx.html
index f7e6e360..004c8816 100644
--- a/html/069allocate.subx.html
+++ b/html/069allocate.subx.html
@@ -734,7 +734,7 @@ if ('onhashchange' in window) {
 673     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 674     # check-ints-equal(h->payload->size, 3, msg)
 675     # . . push args
-676     68/push  "F - test-allocate-array: sets array size in payload"/imm32
+676     68/push  "F - test-allocate-array: sets array size in payload"/imm32
 677     68/push  3/imm32
 678     ff          6/subop/push        1/mod/*+disp8   3/rm32/ebx    .           .             .           .           4/disp8         .                 # push *(ebx+4)
 679     # . . call
@@ -900,7 +900,7 @@ if ('onhashchange' in window) {
 839     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 840     # check-ints-equal(payload->size, 0xc, msg)
 841     # . . push args
-842     68/push  "F - test-copy-array: sets array size in payload"/imm32
+842     68/push  "F - test-copy-array: sets array size in payload"/imm32
 843     68/push  0xc/imm32
 844     ff          6/subop/push        0/mod/indirect  0/rm32/eax    .           .             .           .           .               .                 # push *eax
 845     # . . call
diff --git a/html/070new-stream.subx.html b/html/070new-stream.subx.html
index efe0c943..a9752192 100644
--- a/html/070new-stream.subx.html
+++ b/html/070new-stream.subx.html
@@ -119,7 +119,7 @@ if ('onhashchange' in window) {
  60 $new-stream:abort:
  61     # . _write(2/stderr, error)
  62     # . . push args
- 63     68/push  "new-stream: size too large\n"/imm32
+ 63     68/push  "new-stream: size too large\n"/imm32
  64     68/push  2/imm32/stderr
  65     # . . call
  66     e8/call  _write/disp32
@@ -177,7 +177,7 @@ if ('onhashchange' in window) {
 118     05/add-to-eax  4/imm32
 119     # check-ints-equal(eax->size, 6, msg)
 120     # . . push args
-121     68/push  "F - test-new-stream: sets size correctly"/imm32
+121     68/push  "F - test-new-stream: sets size correctly"/imm32
 122     68/push  6/imm32
 123     ff          6/subop/push        1/mod/*+disp8   0/rm32/eax    .           .             .           .           .               8/disp8           # push *(eax+8)
 124     # . . call
diff --git a/html/075write-int-decimal.subx.html b/html/075write-int-decimal.subx.html
index 4227ba21..97059ffa 100644
--- a/html/075write-int-decimal.subx.html
+++ b/html/075write-int-decimal.subx.html
@@ -2,7 +2,7 @@
 
 
 
-Mu - 075print-int-decimal.subx
+Mu - 075write-int-decimal.subx
 
 
 
@@ -20,6 +20,8 @@ a { color:inherit; }
 .subxFunction { color: #af5f00; text-decoration: underline; }
 .LineNr { }
 .subxS1Comment { color: #0000af; }
+.CommentedCode { color: #8a8a8a; }
+.SpecialChar { color: #d70000; }
 .Normal { color: #000000; background-color: #c6c6c6; padding-bottom: 1px; }
 .Folded { color: #080808; background-color: #949494; }
 .Constant { color: #008787; }
@@ -57,7 +59,7 @@ if ('onhashchange' in window) {
 
 
 
-https://github.com/akkartik/mu/blob/master/075print-int-decimal.subx
+https://github.com/akkartik/mu/blob/master/075write-int-decimal.subx
 
   1 # Helper to print an int32 in decimal.
   2 
@@ -66,7 +68,7 @@ if ('onhashchange' in window) {
   5 # . op          subop               mod             rm32          base        index         scale       r32
   6 # . 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
   7 
-  8 print-int32-decimal:  # out: (addr stream byte), n: int32
+  8 write-int32-decimal:  # out: (addr stream byte), n: int32
   9     # works by generating characters from lowest to highest and pushing them
  10     # to the stack, before popping them one by one into the stream
  11     #
@@ -112,10 +114,10 @@ if ('onhashchange' in window) {
  51     # var eax: int = abs(n)
  52     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           0/r32/eax   0xc/disp8       .                 # copy *(ebp+12) to eax
  53     3d/compare-eax-with  0/imm32
- 54     7d/jump-if->=  $print-int32-decimal:read-loop/disp8
- 55 $print-int32-decimal:negative:
+ 54     7d/jump-if->=  $write-int32-decimal:read-loop/disp8
+ 55 $write-int32-decimal:negative:
  56     f7          3/subop/negate      3/mod/direct    0/rm32/eax    .           .             .           .           .               .                 # negate eax
- 57 $print-int32-decimal:read-loop:
+ 57 $write-int32-decimal:read-loop:
  58     # eax, edx = eax / 10, eax % 10
  59     99/sign-extend-eax-into-edx
  60     f7          7/subop/idiv        3/mod/direct    1/rm32/ecx    .           .             .           .           .               .                 # divide edx:eax by ecx, storing quotient in eax and remainder in edx
@@ -125,14 +127,14 @@ if ('onhashchange' in window) {
  64     52/push-edx
  65     # if (eax == 0) break
  66     3d/compare-eax-and  0/imm32
- 67     7f/jump-if->  $print-int32-decimal:read-loop/disp8
- 68 $print-int32-decimal:read-break:
+ 67     7f/jump-if->  $write-int32-decimal:read-loop/disp8
+ 68 $write-int32-decimal:read-break:
  69     # if (n < 0) push('-')
  70     81          7/subop/compare     1/mod/*+disp8   5/rm32/ebp    .           .             .           .           0xc/disp8       0/imm32           # compare *(ebp+12)
- 71     7d/jump-if->=  $print-int32-decimal:write/disp8
- 72 $print-int32-decimal:push-negative:
+ 71     7d/jump-if->=  $write-int32-decimal:write/disp8
+ 72 $write-int32-decimal:push-negative:
  73     68/push  0x2d/imm32/-
- 74 $print-int32-decimal:write:
+ 74 $write-int32-decimal:write:
  75     # edi = out
  76     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           7/r32/edi   8/disp8         .                 # copy *(ebp+8) to edi
  77     # var w/edx: int = out->write
@@ -142,27 +144,27 @@ if ('onhashchange' in window) {
  81     # var max/ebx: (addr byte) = &out->data[out->size]
  82     8b/copy                         1/mod/*+disp8   7/rm32/edi    .           .             .           3/r32/ebx   8/disp8         .                 # copy *(edi+8) to ebx
  83     8d/copy-address                 1/mod/*+disp8   4/rm32/sib    7/base/edi  3/index/ebx   .           3/r32/ebx   0xc/disp8       .                 # copy edi+ebx+12 to ebx
- 84 $print-int32-decimal:write-loop:
+ 84 $write-int32-decimal:write-loop:
  85     # pop into eax
  86     58/pop-to-eax
  87     # if (eax == sentinel) break
  88     3d/compare-eax-and  0/imm32/sentinel
- 89     74/jump-if-=  $print-int32-decimal:write-break/disp8
+ 89     74/jump-if-=  $write-int32-decimal:write-break/disp8
  90     # if (curr >= max) abort
  91     39/compare                      3/mod/direct    1/rm32/ecx    .           .             .           3/r32/ebx   .               .                 # compare ecx with ebx
- 92     73/jump-if-addr>=  $print-int32-decimal:abort/disp8
- 93 $print-int32-decimal:write-char:
+ 92     73/jump-if-addr>=  $write-int32-decimal:abort/disp8
+ 93 $write-int32-decimal:write-char:
  94     # *curr = AL
  95     88/copy-byte                    0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/AL    .               .                 # copy AL to byte at *ecx
  96     # ++curr
  97     41/increment-ecx
  98     # ++w
  99     42/increment-edx
-100     eb/jump  $print-int32-decimal:write-loop/disp8
-101 $print-int32-decimal:write-break:
+100     eb/jump  $write-int32-decimal:write-loop/disp8
+101 $write-int32-decimal:write-break:
 102     # out->write = w
 103     89/copy                         0/mod/indirect  7/rm32/edi    .           .             .           2/r32/edx   .               .                 # copy edx to *edi
-104 $print-int32-decimal:end:
+104 $write-int32-decimal:end:
 105     # . restore registers
 106     5f/pop-to-edi
 107     5b/pop-to-ebx
@@ -174,10 +176,10 @@ if ('onhashchange' in window) {
 113     5d/pop-to-ebp
 114     c3/return
 115 
-116 $print-int32-decimal:abort:
+116 $write-int32-decimal:abort:
 117     # . _write(2/stderr, error)
 118     # . . push args
-119     68/push  "print-int32-decimal: out of space\n"/imm32
+119     68/push  "write-int32-decimal: out of space\n"/imm32
 120     68/push  2/imm32/stderr
 121     # . . call
 122     e8/call  _write/disp32
@@ -188,7 +190,7 @@ if ('onhashchange' in window) {
 127     e8/call  syscall_exit/disp32
 128     # never gets here
 129 
-130 test-print-int32-decimal:
+130 test-write-int32-decimal:
 131     # - check that a single-digit number converts correctly
 132     # setup
 133     # . clear-stream(_test-stream)
@@ -198,17 +200,17 @@ if ('onhashchange' in window) {
 137     e8/call  clear-stream/disp32
 138     # . . discard args
 139     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
-140     # print-int32-decimal(_test-stream, 9)
+140     # write-int32-decimal(_test-stream, 9)
 141     # . . push args
 142     68/push  9/imm32
 143     68/push  _test-stream/imm32
 144     # . . call
-145     e8/call  print-int32-decimal/disp32
+145     e8/call  write-int32-decimal/disp32
 146     # . . discard args
 147     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 148     # check-stream-equal(_test-stream, "9", msg)
 149     # . . push args
-150     68/push  "F - test-print-int32-decimal"/imm32
+150     68/push  "F - test-write-int32-decimal"/imm32
 151     68/push  "9"/imm32
 152     68/push  _test-stream/imm32
 153     # . . call
@@ -218,7 +220,7 @@ if ('onhashchange' in window) {
 157     # . end
 158     c3/return
 159 
-160 test-print-int32-decimal-zero:
+160 test-write-int32-decimal-zero:
 161     # - check that 0 converts correctly
 162     # setup
 163     # . clear-stream(_test-stream)
@@ -228,17 +230,17 @@ if ('onhashchange' in window) {
 167     e8/call  clear-stream/disp32
 168     # . . discard args
 169     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
-170     # print-int32-decimal(_test-stream, 0)
+170     # write-int32-decimal(_test-stream, 0)
 171     # . . push args
 172     68/push  0/imm32
 173     68/push  _test-stream/imm32
 174     # . . call
-175     e8/call  print-int32-decimal/disp32
+175     e8/call  write-int32-decimal/disp32
 176     # . . discard args
 177     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 178     # check-stream-equal(_test-stream, "0", msg)
 179     # . . push args
-180     68/push  "F - test-print-int32-decimal-zero"/imm32
+180     68/push  "F - test-write-int32-decimal-zero"/imm32
 181     68/push  "0"/imm32
 182     68/push  _test-stream/imm32
 183     # . . call
@@ -248,7 +250,7 @@ if ('onhashchange' in window) {
 187     # . end
 188     c3/return
 189 
-190 test-print-int32-decimal-multiple-digits:
+190 test-write-int32-decimal-multiple-digits:
 191     # - check that a multi-digit number converts correctly
 192     # setup
 193     # . clear-stream(_test-stream)
@@ -258,17 +260,17 @@ if ('onhashchange' in window) {
 197     e8/call  clear-stream/disp32
 198     # . . discard args
 199     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
-200     # print-int32-decimal(_test-stream, 10)
+200     # write-int32-decimal(_test-stream, 10)
 201     # . . push args
 202     68/push  0xa/imm32
 203     68/push  _test-stream/imm32
 204     # . . call
-205     e8/call  print-int32-decimal/disp32
+205     e8/call  write-int32-decimal/disp32
 206     # . . discard args
 207     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 208     # check-stream-equal(_test-stream, "10", msg)
 209     # . . push args
-210     68/push  "F - test-print-int32-decimal-multiple-digits"/imm32
+210     68/push  "F - test-write-int32-decimal-multiple-digits"/imm32
 211     68/push  "10"/imm32
 212     68/push  _test-stream/imm32
 213     # . . call
@@ -278,7 +280,7 @@ if ('onhashchange' in window) {
 217     # . end
 218     c3/return
 219 
-220 test-print-int32-decimal-negative:
+220 test-write-int32-decimal-negative:
 221     # - check that a negative single-digit number converts correctly
 222     # setup
 223     # . clear-stream(_test-stream)
@@ -288,18 +290,18 @@ if ('onhashchange' in window) {
 227     e8/call  clear-stream/disp32
 228     # . . discard args
 229     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
-230     # print-int32-decimal(_test-stream, -9)
+230     # write-int32-decimal(_test-stream, -9)
 231     # . . push args
 232     68/push  -9/imm32
 233     68/push  _test-stream/imm32
 234     # . . call
-235     e8/call  print-int32-decimal/disp32
+235     e8/call  write-int32-decimal/disp32
 236     # . . discard args
 237     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 238 +-- 26 lines: #?     # dump _test-stream ------------------------------------------------------------------------------------------------------------------------------------------------
 264     # check-stream-equal(_test-stream, "-9", msg)
 265     # . . push args
-266     68/push  "F - test-print-int32-decimal-negative"/imm32
+266     68/push  "F - test-write-int32-decimal-negative"/imm32
 267     68/push  "-9"/imm32
 268     68/push  _test-stream/imm32
 269     # . . call
@@ -309,7 +311,7 @@ if ('onhashchange' in window) {
 273     # . end
 274     c3/return
 275 
-276 test-print-int32-decimal-negative-multiple-digits:
+276 test-write-int32-decimal-negative-multiple-digits:
 277     # - check that a multi-digit number converts correctly
 278     # setup
 279     # . clear-stream(_test-stream)
@@ -319,17 +321,17 @@ if ('onhashchange' in window) {
 283     e8/call  clear-stream/disp32
 284     # . . discard args
 285     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
-286     # print-int32-decimal(_test-stream, -10)
+286     # write-int32-decimal(_test-stream, -10)
 287     # . . push args
 288     68/push  -0xa/imm32
 289     68/push  _test-stream/imm32
 290     # . . call
-291     e8/call  print-int32-decimal/disp32
+291     e8/call  write-int32-decimal/disp32
 292     # . . discard args
 293     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 294     # check-stream-equal(_test-stream, "-10", msg)
 295     # . . push args
-296     68/push  "F - test-print-int32-decimal-negative-multiple-digits"/imm32
+296     68/push  "F - test-write-int32-decimal-negative-multiple-digits"/imm32
 297     68/push  "-10"/imm32
 298     68/push  _test-stream/imm32
 299     # . . call
@@ -370,7 +372,7 @@ if ('onhashchange' in window) {
 334     # . . push args
 335     68/push  0x2f/imm32
 336     # . . call
-337     e8/call  is-decimal-digit?/disp32
+337     e8/call  is-decimal-digit?/disp32
 338     # . . discard args
 339     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 340     # check-ints-equal(eax, 0, msg)
@@ -389,7 +391,7 @@ if ('onhashchange' in window) {
 353     # . . push args
 354     68/push  0x30/imm32
 355     # . . call
-356     e8/call  is-decimal-digit?/disp32
+356     e8/call  is-decimal-digit?/disp32
 357     # . . discard args
 358     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 359     # check-ints-equal(eax, 1, msg)
@@ -405,7 +407,7 @@ if ('onhashchange' in window) {
 369     # . . push args
 370     68/push  0x39/imm32
 371     # . . call
-372     e8/call  is-decimal-digit?/disp32
+372     e8/call  is-decimal-digit?/disp32
 373     # . . discard args
 374     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 375     # check-ints-equal(eax, 1, msg)
@@ -424,7 +426,7 @@ if ('onhashchange' in window) {
 388     # . . push args
 389     68/push  0x3a/imm32
 390     # . . call
-391     e8/call  is-decimal-digit?/disp32
+391     e8/call  is-decimal-digit?/disp32
 392     # . . discard args
 393     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 394     # check-ints-equal(eax, 0, msg)
@@ -438,7 +440,68 @@ if ('onhashchange' in window) {
 402     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0xc/imm32         # add to esp
 403     c3/return
 404 
-405 # . . vim:nowrap:textwidth=0
+405 to-decimal-digit:  # in: byte -> out/eax: int
+406     # . prologue
+407     55/push-ebp
+408     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
+409     # eax = in
+410     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           0/r32/eax   8/disp8         .                 # copy *(ebp+8) to eax
+411 $to-decimal-digit:check0:
+412     # if (eax < '0') goto abort
+413     3d/compare-eax-with  0x30/imm32/0
+414     7c/jump-if-<  $to-decimal-digit:abort/disp8
+415 $to-decimal-digit:check1:
+416     # if (eax > '9') goto abort
+417     3d/compare-eax-with  0x39/imm32/f
+418     7f/jump-if->  $to-decimal-digit:abort/disp8
+419 $to-decimal-digit:digit:
+420     # return eax - '0'
+421     2d/subtract-from-eax  0x30/imm32/0
+422 $to-decimal-digit:end:
+423     # . epilogue
+424     89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
+425     5d/pop-to-ebp
+426     c3/return
+427 
+428 $to-decimal-digit:abort:
+429     # . write-buffered(stderr, error)
+430     # . . push args
+431     68/push  "to-decimal-digit: not a digit character: "/imm32
+432     68/push  Stderr/imm32
+433     # . . call
+434     e8/call  write-buffered/disp32
+435     # . . discard args
+436     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
+437     # . write-byte-buffered(stderr, %eax)
+438     # . . push args
+439     50/push-eax
+440     68/push  Stderr/imm32
+441     # . . call
+442 #?     e8/call  write-byte-buffered/disp32
+443     e8/call  write-int32-hex-buffered/disp32
+444     # . . discard args
+445     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
+446     # . write-buffered(stderr, "\n")
+447     # . . push args
+448     68/push  Newline/imm32
+449     68/push  Stderr/imm32
+450     # . . call
+451     e8/call  write-buffered/disp32
+452     # . . discard args
+453     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
+454     # . flush(Stderr)
+455     # . . push args
+456     68/push  Stderr/imm32
+457     # . . call
+458     e8/call  flush/disp32
+459     # . . discard args
+460     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
+461     # . syscall(exit, 1)
+462     bb/copy-to-ebx  1/imm32
+463     e8/call  syscall_exit/disp32
+464     # never gets here
+465 
+466 # . . vim:nowrap:textwidth=0
 
diff --git a/html/078emit-hex.subx.html b/html/078emit-hex.subx.html index ef91c16f..445e51c8 100644 --- a/html/078emit-hex.subx.html +++ b/html/078emit-hex.subx.html @@ -85,12 +85,12 @@ if ('onhashchange' in window) { 26 # if (curr >= width) break 27 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx with edx 28 7d/jump-if->= $emit-hex:end/disp8 - 29 # print-byte-buffered(out, ebx) # only BL used + 29 # write-byte-hex-buffered(out, ebx) # only BL used 30 # . . push args 31 53/push-ebx 32 57/push-edi 33 # . . call - 34 e8/call print-byte-buffered/disp32 + 34 e8/call write-byte-hex-buffered/disp32 35 # . . discard args 36 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 37 # write-byte-buffered(out, ' ') diff --git a/html/091write-int.subx.html b/html/091write-int.subx.html index 05bffafb..67168f07 100644 --- a/html/091write-int.subx.html +++ b/html/091write-int.subx.html @@ -58,7 +58,7 @@ if ('onhashchange' in window) { https://github.com/akkartik/mu/blob/master/091write-int.subx
-  1 # write-int: add a single int to a stream
+  1 # write-int: add (the binary representation of) a single int to a stream
   2 
   3 == code
   4 #   instruction                     effective address                                                   register    displacement    immediate
diff --git a/html/103screen.subx.html b/html/103screen.subx.html
index 415a14c4..d84f6248 100644
--- a/html/103screen.subx.html
+++ b/html/103screen.subx.html
@@ -146,7 +146,7 @@ if ('onhashchange' in window) {
  88     c3/return
  89 
  90 # row and col count from the top-left as (1, 1)
- 91 move-cursor:  # row: int, column: int
+ 91 move-cursor-on-screen:  # row: int, column: int
  92     # . prologue
  93     55/push-ebp
  94     89/<- %ebp 4/r32/esp
@@ -161,13 +161,13 @@ if ('onhashchange' in window) {
 103     # construct directive in buf
 104     (write %ecx Esc)
 105     (write %ecx "[")
-106     (print-int32-decimal %ecx *(ebp+8))
+106     (write-int32-decimal %ecx *(ebp+8))
 107     (write %ecx ";")
-108     (print-int32-decimal %ecx *(ebp+0xc))
+108     (write-int32-decimal %ecx *(ebp+0xc))
 109     (write %ecx "H")
 110     # flush
 111     (write-stream 2 %ecx)
-112 $move-cursor:end:
+112 $move-cursor-on-screen:end:
 113     # . reclaim locals
 114     81 0/subop/add %esp 0x2c/imm32
 115     # . restore registers
@@ -177,20 +177,20 @@ if ('onhashchange' in window) {
 119     5d/pop-to-ebp
 120     c3/return
 121 
-122 print-string:  # s: (addr array byte)
+122 print-string-to-screen:  # s: (addr array byte)
 123     # . prologue
 124     55/push-ebp
 125     89/<- %ebp 4/r32/esp
 126     #
 127     (write 2 *(ebp+8))
-128 $print-string:end:
+128 $print-string-to-screen:end:
 129     # . epilogue
 130     89/<- %esp 5/r32/ebp
 131     5d/pop-to-ebp
 132     c3/return
 133 
 134 # just because Mu has no support for global variables yet
-135 print-byte:  # c: byte
+135 print-byte-to-screen:  # c: byte
 136     # . prologue
 137     55/push-ebp
 138     89/<- %ebp 4/r32/esp
@@ -201,7 +201,7 @@ if ('onhashchange' in window) {
 143     68/push 4/imm32/size
 144     89/<- %ecx 4/r32/esp
 145     (write 2 %ecx)
-146 $print-byte:end:
+146 $print-byte-to-screen:end:
 147     # . reclaim locals
 148     81 0/subop/add %esp 8/imm32
 149     # . restore registers
@@ -212,20 +212,20 @@ if ('onhashchange' in window) {
 154     c3/return
 155 
 156 # just because Mu has no support for global variables yet
-157 print-int32-to-screen:  # n: int
+157 print-int32-hex-to-screen:  # n: int
 158     # . prologue
 159     55/push-ebp
 160     89/<- %ebp 4/r32/esp
 161     #
-162     (print-int32-buffered Stdout *(ebp+8))
+162     (write-int32-hex-buffered Stdout *(ebp+8))
 163     (flush Stdout)
-164 $print-int32-to-screen:end:
+164 $print-int32-hex-to-screen:end:
 165     # . epilogue
 166     89/<- %esp 5/r32/ebp
 167     5d/pop-to-ebp
 168     c3/return
 169 
-170 reset-formatting:
+170 reset-formatting-on-screen:
 171     # . prologue
 172     55/push-ebp
 173     89/<- %ebp 4/r32/esp
@@ -234,13 +234,13 @@ if ('onhashchange' in window) {
 176     (write 2 "(B")
 177     (write 2 Esc)
 178     (write 2 "[m")
-179 $reset-formatting:end:
+179 $reset-formatting-on-screen:end:
 180     # . epilogue
 181     89/<- %esp 5/r32/ebp
 182     5d/pop-to-ebp
 183     c3/return
 184 
-185 start-color:  # fg: int, bg: int
+185 start-color-on-screen:  # fg: int, bg: int
 186     # . prologue
 187     55/push-ebp
 188     89/<- %ebp 4/r32/esp
@@ -256,16 +256,16 @@ if ('onhashchange' in window) {
 198     # . set fg
 199     (write %ecx Esc)
 200     (write %ecx "[38;5;")
-201     (print-int32-decimal %ecx *(ebp+8))
+201     (write-int32-decimal %ecx *(ebp+8))
 202     (write %ecx "m")
 203     # . set bg
 204     (write %ecx Esc)
 205     (write %ecx "[48;5;")
-206     (print-int32-decimal %ecx *(ebp+0xc))
+206     (write-int32-decimal %ecx *(ebp+0xc))
 207     (write %ecx "m")
 208     # flush
 209     (write-stream 2 %ecx)
-210 $start-color:end:
+210 $start-color-on-screen:end:
 211     # . reclaim locals
 212     81 0/subop/add %esp 0x2c/imm32
 213     # . restore registers
@@ -275,73 +275,73 @@ if ('onhashchange' in window) {
 217     5d/pop-to-ebp
 218     c3/return
 219 
-220 start-bold:
+220 start-bold-on-screen:
 221     # . prologue
 222     55/push-ebp
 223     89/<- %ebp 4/r32/esp
 224     #
 225     (write 2 Esc)
 226     (write 2 "[1m")
-227 $start-bold:end:
+227 $start-bold-on-screen:end:
 228     # . epilogue
 229     89/<- %esp 5/r32/ebp
 230     5d/pop-to-ebp
 231     c3/return
 232 
-233 start-underline:
+233 start-underline-on-screen:
 234     # . prologue
 235     55/push-ebp
 236     89/<- %ebp 4/r32/esp
 237     #
 238     (write 2 Esc)
 239     (write 2 "[4m")
-240 $start-underline:end:
+240 $start-underline-on-screen:end:
 241     # . epilogue
 242     89/<- %esp 5/r32/ebp
 243     5d/pop-to-ebp
 244     c3/return
 245 
-246 start-reverse-video:
+246 start-reverse-video-on-screen:
 247     # . prologue
 248     55/push-ebp
 249     89/<- %ebp 4/r32/esp
 250     #
 251     (write 2 Esc)
 252     (write 2 "[7m")
-253 $start-reverse-video:end:
+253 $start-reverse-video-on-screen:end:
 254     # . epilogue
 255     89/<- %esp 5/r32/ebp
 256     5d/pop-to-ebp
 257     c3/return
 258 
 259 # might require enabling blinking in your terminal program
-260 start-blinking:
+260 start-blinking-on-screen:
 261     # . prologue
 262     55/push-ebp
 263     89/<- %ebp 4/r32/esp
 264     #
 265     (write 2 Esc)
 266     (write 2 "[5m")
-267 $start-blinking:end:
+267 $start-blinking-on-screen:end:
 268     # . epilogue
 269     89/<- %esp 5/r32/ebp
 270     5d/pop-to-ebp
 271     c3/return
 272 
-273 hide-cursor:
+273 hide-cursor-on-screen:
 274     # . prologue
 275     55/push-ebp
 276     89/<- %ebp 4/r32/esp
 277     #
 278     (write 2 Esc)
 279     (write 2 "[?25l")
-280 $hide-cursor:end:
+280 $hide-cursor-on-screen:end:
 281     # . epilogue
 282     89/<- %esp 5/r32/ebp
 283     5d/pop-to-ebp
 284     c3/return
 285 
-286 show-cursor:
+286 show-cursor-on-screen:
 287     # . prologue
 288     55/push-ebp
 289     89/<- %ebp 4/r32/esp
@@ -350,7 +350,7 @@ if ('onhashchange' in window) {
 292     (write 2 "[?12l")
 293     (write 2 Esc)
 294     (write 2 "[?25h")
-295 $show-cursor:end:
+295 $show-cursor-on-screen:end:
 296     # . epilogue
 297     89/<- %esp 5/r32/ebp
 298     5d/pop-to-ebp
diff --git a/html/104keyboard.subx.html b/html/104keyboard.subx.html
index a45867e7..35952e38 100644
--- a/html/104keyboard.subx.html
+++ b/html/104keyboard.subx.html
@@ -85,26 +85,26 @@ if ('onhashchange' in window) {
  27     e8/call syscall_ioctl/disp32
  28     # terminal-info->c_iflags &= Keyboard-immediate-mode-iflags
  29 #?     (write-buffered Stderr "iflags before: ")
- 30 #?     (print-int32-buffered Stderr *esi)
+ 30 #?     (write-int32-hex-buffered Stderr *esi)
  31 #?     (write-buffered Stderr Newline)
  32 #?     (flush Stderr)
  33     8b/-> *esi 0/r32/eax  # Termios-c_iflag
  34     23/and *Keyboard-immediate-mode-iflags 0/r32/eax
  35     89/<- *esi 0/r32/eax  # Termios-c_iflag
  36 #?     (write-buffered Stderr "iflags after: ")
- 37 #?     (print-int32-buffered Stderr *esi)
+ 37 #?     (write-int32-hex-buffered Stderr *esi)
  38 #?     (write-buffered Stderr Newline)
  39 #?     (flush Stderr)
  40     # terminal-info->c_lflags &= Keyboard-immediate-mode-lflags
  41 #?     (write-buffered Stderr "lflags before: ")
- 42 #?     (print-int32-buffered Stderr *(esi+0xc))
+ 42 #?     (write-int32-hex-buffered Stderr *(esi+0xc))
  43 #?     (write-buffered Stderr Newline)
  44 #?     (flush Stderr)
  45     8b/-> *(esi+0xc) 0/r32/eax  # Termios-c_lflag
  46     23/and *Keyboard-immediate-mode-lflags 0/r32/eax
  47     89/<- *(esi+0xc) 0/r32/eax  # Termios-c_lflag
  48 #?     (write-buffered Stderr "lflags after: ")
- 49 #?     (print-int32-buffered Stderr *(esi+0xc))
+ 49 #?     (write-int32-hex-buffered Stderr *(esi+0xc))
  50 #?     (write-buffered Stderr Newline)
  51 #?     (flush Stderr)
  52     # ioctl(*Terminal-file-descriptor, TCSETS, terminal-info)
diff --git a/html/106size.subx.html b/html/106size.subx.html
new file mode 100644
index 00000000..549d44ef
--- /dev/null
+++ b/html/106size.subx.html
@@ -0,0 +1,77 @@
+
+
+
+
+Mu - 106size.subx
+
+
+
+
+
+
+
+
+
+
+https://github.com/akkartik/mu/blob/master/106size.subx
+
+ 1 # Size of an array in bytes.
+ 2 
+ 3 == code
+ 4 
+ 5 size:  # in: (addr array _) -> result/eax: int
+ 6     # . prologue
+ 7     55/push-ebp
+ 8     89/<- %ebp 4/r32/esp
+ 9     # eax = in
+10     8b/-> *(ebp+8) 0/r32/eax
+11     #
+12     8b/-> *eax 0/r32/eax
+13 $size:end:
+14     # . epilogue
+15     89/<- %esp 5/r32/ebp
+16     5d/pop-to-ebp
+17     c3/return
+
+ + + diff --git a/html/apps/arith.mu.html b/html/apps/arith.mu.html index 64db9a11..7d2e2234 100644 --- a/html/apps/arith.mu.html +++ b/html/apps/arith.mu.html @@ -94,19 +94,19 @@ if ('onhashchange' in window) { 35 fn main -> exit-status/ebx: int { 36 var look/esi: byte <- copy 0 # lookahead 37 var n/eax: int <- copy 0 # result of each expression - 38 print-string "press ctrl-c or ctrl-d to exit\n" + 38 print-string-to-screen "press ctrl-c or ctrl-d to exit\n" 39 # read-eval-print loop 40 { 41 # print prompt - 42 print-string "> " + 42 print-string-to-screen "> " 43 # read and eval 44 n, look <- simplify # we explicitly thread 'look' everywhere 45 # if (look == 0) break 46 compare look, 0 47 break-if-= 48 # print - 49 print-int32-to-screen n - 50 print-string "\n" + 49 print-int32-to-screen n + 50 print-string-to-screen "\n" 51 # 52 loop 53 } @@ -115,7 +115,7 @@ if ('onhashchange' in window) { 56 57 fn simplify -> result/eax: int, look/esi: byte { 58 # prime the pump - 59 look <- get-char # prime the pump + 59 look <- get-char 60 # do it 61 result, look <- expression look 62 } @@ -218,14 +218,14 @@ if ('onhashchange' in window) { 159 break $factor:body 160 } 161 # otherwise recurse -162 look <- get-char look # '(' +162 look <- get-char # '(' 163 result, look <- expression look 164 look <- skip-spaces look -165 look <- get-char look # ')' +165 look <- get-char # ')' 166 } # $factor:body 167 } 168 -169 fn is-mul-or-div? c: byte -> result/eax: bool { +169 fn is-mul-or-div? c: byte -> result/eax: boolean { 170 $is-mul-or-div?:body: { 171 compare c, 0x2a # '*' 172 { @@ -243,7 +243,7 @@ if ('onhashchange' in window) { 184 } # $is-mul-or-div?:body 185 } 186 -187 fn is-add-or-sub? c: byte -> result/eax: bool { +187 fn is-add-or-sub? c: byte -> result/eax: boolean { 188 $is-add-or-sub?:body: { 189 compare c, 0x2b # '+' 190 { @@ -270,13 +270,13 @@ if ('onhashchange' in window) { 211 look <- copy _look # should be a no-op 212 var out/edi: int <- copy 0 213 { -214 var first-digit/eax: int <- to-decimal-digit look +214 var first-digit/eax: int <- to-decimal-digit look 215 out <- copy first-digit 216 } 217 { 218 look <- get-char 219 # done? -220 var digit?/eax: bool <- is-decimal-digit? look +220 var digit?/eax: boolean <- is-decimal-digit? look 221 compare digit?, 0 # false 222 break-if-= 223 # out *= 10 @@ -285,7 +285,7 @@ if ('onhashchange' in window) { 226 out <- multiply ten 227 } 228 # out += digit(look) -229 var digit/eax: int <- to-decimal-digit look +229 var digit/eax: int <- to-decimal-digit look 230 out <- add digit 231 loop 232 } @@ -308,7 +308,7 @@ if ('onhashchange' in window) { 249 compare look, 0 250 { 251 break-if-!= -252 print-string "^D\n" +252 print-string-to-screen "^D\n" 253 syscall_exit 254 } 255 } diff --git a/html/apps/braces.subx.html b/html/apps/braces.subx.html index 6f164c6b..2155eafb 100644 --- a/html/apps/braces.subx.html +++ b/html/apps/braces.subx.html @@ -218,7 +218,7 @@ if ('onhashchange' in window) { 159 $subx-braces:emit-curly-open: 160 # print(out, "_loop" next-label-id ":") 161 (write-buffered *(ebp+0xc) "_loop") -162 (print-int32-buffered *(ebp+0xc) %ebx) +162 (write-int32-hex-buffered *(ebp+0xc) %ebx) 163 (write-buffered *(ebp+0xc) ":") 164 # push(label-stack, next-label-id) 165 (push %edx %ebx) @@ -235,7 +235,7 @@ if ('onhashchange' in window) { 176 (pop %edx) 177 # print(out, "_break" eax ":") 178 (write-buffered *(ebp+0xc) "_break") -179 (print-int32-buffered *(ebp+0xc) %eax) +179 (write-int32-hex-buffered *(ebp+0xc) %eax) 180 (write-buffered *(ebp+0xc) ":") 181 # continue 182 e9/jump $subx-braces:next-line/disp32 @@ -266,7 +266,7 @@ if ('onhashchange' in window) { 207 (top %edx) 208 # print(out, "_break" eax) 209 (write-buffered *(ebp+0xc) "_break") -210 (print-int32-buffered *(ebp+0xc) %eax) +210 (write-int32-hex-buffered *(ebp+0xc) %eax) 211 # word-slice->start += len("break") 212 81 0/subop/add *edi 5/imm32/strlen 213 # emit rest of word as usual @@ -282,7 +282,7 @@ if ('onhashchange' in window) { 223 (top %edx) 224 # print(out, "_loop" eax) 225 (write-buffered *(ebp+0xc) "_loop") -226 (print-int32-buffered *(ebp+0xc) %eax) +226 (write-int32-hex-buffered *(ebp+0xc) %eax) 227 # word-slice->start += len("loop") 228 81 0/subop/add *edi 4/imm32/strlen 229 # fall through diff --git a/html/apps/browse.mu.html b/html/apps/browse.mu.html index ddc9170d..b7314157 100644 --- a/html/apps/browse.mu.html +++ b/html/apps/browse.mu.html @@ -66,7 +66,7 @@ if ('onhashchange' in window) { 7 # Press 'q' to quit. All other keys scroll down. 8 9 fn main args-on-stack: (addr array (addr array byte)) -> exit-status/ebx: int { - 10 +-- 20 lines: # var file/esi: (addr buffered-file) = open args-on-stack[1] for reading ------------------------------------------------------------------------------------------------------------------------------------------------------- + 10 +-- 20 lines: # var file/esi: (addr buffered-file) = open args-on-stack[1] for reading -------------------------------------------------------------------------------------------------- 30 enable-screen-grid-mode 31 var nrows/eax: int <- copy 0 32 var ncols/ecx: int <- copy 0 @@ -105,7 +105,7 @@ if ('onhashchange' in window) { 65 var leftcol/edx: int <- copy 5 # page-margin 66 var rightcol/ebx: int <- copy leftcol 67 rightcol <- add 0x40 # page-width = 64 characters - 68 start-color 0xec, 7 # 236 = darkish gray + 68 start-color-on-screen 0xec, 7 # 236 = darkish gray 69 { 70 compare rightcol, ncols 71 break-if->= @@ -126,7 +126,7 @@ if ('onhashchange' in window) { 86 compare row, botrow 87 break-if->= 88 var col/edx: int <- copy leftcol - 89 move-cursor row, col + 89 move-cursor-on-screen row, col 90 { 91 compare col, rightcol 92 break-if->= @@ -136,7 +136,7 @@ if ('onhashchange' in window) { 96 update-attributes c, r 97 compare c, 0xa # newline 98 break-if-= # no need to print newlines - 99 print-byte c + 99 print-byte-to-screen c 100 col <- increment 101 loop 102 } @@ -156,7 +156,7 @@ if ('onhashchange' in window) { 116 { 117 break-if-!= 118 # r->current-state == 0 && c == '*' -119 start-bold +119 start-bold-on-screen 120 copy-to *state, 1 121 break $update-attributes:check-state 122 } @@ -164,7 +164,7 @@ if ('onhashchange' in window) { 124 { 125 break-if-!= 126 # r->current-state == 0 && c == '_' -127 start-bold +127 start-bold-on-screen 128 copy-to *state, 1 129 break $update-attributes:check-state 130 } @@ -176,7 +176,7 @@ if ('onhashchange' in window) { 136 { 137 break-if-!= 138 # r->current-state == 1 && c == '*' -139 reset-formatting +139 reset-formatting-on-screen 140 copy-to *state, 0 141 break $update-attributes:check-state 142 } @@ -184,7 +184,7 @@ if ('onhashchange' in window) { 144 { 145 break-if-!= 146 # r->current-state == 1 && c == '_' -147 reset-formatting +147 reset-formatting-on-screen 148 copy-to *state, 0 149 break $update-attributes:check-state 150 } @@ -199,11 +199,11 @@ if ('onhashchange' in window) { 159 compare row, botrow 160 break-if->= 161 var col/edx: int <- copy leftcol -162 move-cursor row, col +162 move-cursor-on-screen row, col 163 { 164 compare col, rightcol 165 break-if->= -166 print-string " " +166 print-string-to-screen " " 167 col <- increment 168 loop 169 } @@ -216,7 +216,7 @@ if ('onhashchange' in window) { 176 var c/eax: byte <- read-byte-buffered in 177 compare c, 0xffffffff # EOF marker 178 break-if-= -179 print-byte c +179 print-byte-to-screen c 180 loop 181 }
diff --git a/html/apps/calls.subx.html b/html/apps/calls.subx.html index fbf7739d..d80ca4b0 100644 --- a/html/apps/calls.subx.html +++ b/html/apps/calls.subx.html @@ -385,7 +385,7 @@ if ('onhashchange' in window) { 363 # write-buffered(out, "/disp32\n") 364 # # emit pops 365 # write-buffered(out, "81 0/subop/add %esp ") - 366 # print-int32-buffered(out, words->write >> 1 - 4) + 366 # write-int32-hex-buffered(out, words->write >> 1 - 4) 367 # write-buffered(out, "/imm32\n") 368 # 369 # . prologue @@ -509,7 +509,7 @@ if ('onhashchange' in window) { 487 e8/call write-buffered/disp32 488 # . . discard args 489 81 0/subop/add %esp 8/imm32 - 490 # print-int32-buffered(out, words->write >> 1 - 4) + 490 # write-int32-hex-buffered(out, words->write >> 1 - 4) 491 # . . push args 492 8b/-> *esi 0/r32/eax 493 c1/shift 7/subop/arith-right %eax 1/imm8 @@ -517,7 +517,7 @@ if ('onhashchange' in window) { 495 50/push-eax 496 ff 6/subop/push *(ebp+8) 497 # . . call - 498 e8/call print-int32-buffered/disp32 + 498 e8/call write-int32-hex-buffered/disp32 499 # . . discard args 500 81 0/subop/add %esp 8/imm32 501 # write-buffered(out, "/imm32\n") diff --git a/html/apps/dquotes.subx.html b/html/apps/dquotes.subx.html index 36e36047..56ced9e6 100644 --- a/html/apps/dquotes.subx.html +++ b/html/apps/dquotes.subx.html @@ -392,12 +392,12 @@ if ('onhashchange' in window) { 329 e8/call write/disp32 330 # . . discard args 331 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp - 332 # . print-int32-decimal(out-segment, *Next-string-literal) + 332 # . write-int32-decimal(out-segment, *Next-string-literal) 333 # . . push args 334 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Next-string-literal/disp32 # push *Next-string-literal 335 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) 336 # . . call - 337 e8/call print-int32-decimal/disp32 + 337 e8/call write-int32-decimal/disp32 338 # . . discard args 339 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 340 # . write(out-segment, ":\n") @@ -433,12 +433,12 @@ if ('onhashchange' in window) { 370 e8/call write-buffered/disp32 371 # . . discard args 372 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp - 373 # . print-int32-decimal(int32-stream, *Next-string-literal) + 373 # . write-int32-decimal(int32-stream, *Next-string-literal) 374 # . . push args 375 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Next-string-literal/disp32 # push *Next-string-literal 376 51/push-ecx 377 # . . call - 378 e8/call print-int32-decimal/disp32 + 378 e8/call write-int32-decimal/disp32 379 # . . discard args 380 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 381 # . write-stream-data(out, int32-stream) @@ -921,12 +921,12 @@ if ('onhashchange' in window) { 915 # . . discard args 916 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 917 # print(out, "#{len}/imm32 ") - 918 # . print-int32(out, len) + 918 # . write-int32-hex(out, len) 919 # . . push args 920 50/push-eax 921 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 922 # . . call - 923 e8/call print-int32/disp32 + 923 e8/call write-int32-hex/disp32 924 # . . discard args 925 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 926 # . write(out, "/imm32 ") @@ -971,7 +971,7 @@ if ('onhashchange' in window) { 965 51/push-ecx 966 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 967 # . . call - 968 e8/call append-byte-hex/disp32 + 968 e8/call append-byte-hex/disp32 969 # . . discard args 970 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 971 # if (is-alphanumeric?(*curr)) print(out, "/#{*curr}") diff --git a/html/apps/ex1.mu.html b/html/apps/ex1.mu.html index 9cde8645..aa62b62e 100644 --- a/html/apps/ex1.mu.html +++ b/html/apps/ex1.mu.html @@ -14,11 +14,11 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background- body { font-size:12pt; font-family: monospace; color: #000000; background-color: #c6c6c6; } a { color:inherit; } * { font-size:12pt; font-size: 1em; } -.muFunction { color: #af5f00; text-decoration: underline; } .LineNr { } +.muFunction { color: #af5f00; text-decoration: underline; } +.SpecialChar { color: #d70000; } .Comment { color: #005faf; } .Constant { color: #008787; } -.Special { color: #ff6060; } .Delimiter { color: #c000c0; } .PreProc { color: #c000c0; } --> @@ -67,7 +67,7 @@ if ('onhashchange' in window) { 9 # 42 10 11 fn main -> result/ebx: int { -12 result <- copy 0x2a # Mu requires hexadecimal +12 result <- copy 0x2a # Mu requires hexadecimal 13 }
diff --git a/html/apps/ex2.mu.html b/html/apps/ex2.mu.html index e8c04536..d891a1f6 100644 --- a/html/apps/ex2.mu.html +++ b/html/apps/ex2.mu.html @@ -14,11 +14,11 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background- body { font-size:12pt; font-family: monospace; color: #000000; background-color: #c6c6c6; } a { color:inherit; } * { font-size:12pt; font-size: 1em; } -.muFunction { color: #af5f00; text-decoration: underline; } .LineNr { } +.muFunction { color: #af5f00; text-decoration: underline; } +.SpecialChar { color: #d70000; } .Comment { color: #005faf; } .Constant { color: #008787; } -.Special { color: #ff6060; } .Delimiter { color: #c000c0; } .PreProc { color: #c000c0; } --> @@ -66,12 +66,12 @@ if ('onhashchange' in window) { 8 # 7 9 10 fn main -> result/ebx: int { -11 result <- do-add 3 4 +11 result <- do-add 3 4 12 } 13 14 fn do-add a: int, b: int -> result/ebx: int { -15 result <- copy a -16 result <- add b +15 result <- copy a +16 result <- add b 17 } diff --git a/html/apps/ex3.2.mu.html b/html/apps/ex3.2.mu.html index 1cbfd53d..ea4eb2eb 100644 --- a/html/apps/ex3.2.mu.html +++ b/html/apps/ex3.2.mu.html @@ -14,11 +14,11 @@ pre { white-space: pre-wrap; font-family: monospace; color: #000000; background- body { font-size:12pt; font-family: monospace; color: #000000; background-color: #c6c6c6; } a { color:inherit; } * { font-size:12pt; font-size: 1em; } -.muFunction { color: #af5f00; text-decoration: underline; } .LineNr { } +.muFunction { color: #af5f00; text-decoration: underline; } +.SpecialChar { color: #d70000; } .Comment { color: #005faf; } .Constant { color: #008787; } -.Special { color: #ff6060; } .Delimiter { color: #c000c0; } .PreProc { color: #c000c0; } --> @@ -67,24 +67,24 @@ if ('onhashchange' in window) { 9 fn main -> result/ebx: int { 10 # populate a 11 var a: (array int 0xb) # 11; we waste index 0 -12 var i/ecx: int <- copy 1 +12 var i/ecx: int <- copy 1 13 { 14 compare i, 0xb 15 break-if->= -16 var x/eax: (addr int) <- index a, i +16 var x/eax: (addr int) <- index a, i 17 copy-to *x, i -18 i <- increment +18 i <- increment 19 loop 20 } 21 # sum -22 result <- copy 0 -23 i <- copy 1 +22 result <- copy 0 +23 i <- copy 1 24 { 25 compare i, 0xb 26 break-if->= -27 var x/eax: (addr int) <- index a, i -28 result <- add *x -29 i <- increment +27 var x/eax: (addr int) <- index a, i +28 result <- add *x +29 i <- increment 30 loop 31 } 32 } diff --git a/html/apps/factorial.subx.html b/html/apps/factorial.subx.html index 0b7b8ff4..8abcdfbc 100644 --- a/html/apps/factorial.subx.html +++ b/html/apps/factorial.subx.html @@ -129,12 +129,12 @@ if ('onhashchange' in window) { 68 68/push 0/imm32/read 69 68/push 0/imm32/write 70 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx - 71 # print-int32-decimal(buffer, eax) + 71 # write-int32-decimal(buffer, eax) 72 # . . push args 73 50/push-eax 74 51/push-ecx 75 # . . call - 76 e8/call print-int32-decimal/disp32 + 76 e8/call write-int32-decimal/disp32 77 # . . discard args 78 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 79 # write-stream(stderr, buffer) diff --git a/html/apps/mu.subx.html b/html/apps/mu.subx.html index 35b83337..13b37842 100644 --- a/html/apps/mu.subx.html +++ b/html/apps/mu.subx.html @@ -5620,7 +5620,7 @@ if ('onhashchange' in window) { 6088 6089 $parse-mu:error2: 6090 # error(vars->top " vars not reclaimed after fn '" new-function->name "'\n") - 6091 (print-int32-buffered *(ebp+0xc) *ebx) + 6091 (write-int32-hex-buffered *(ebp+0xc) *ebx) 6092 (write-buffered *(ebp+0xc) " vars not reclaimed after fn '") 6093 (write-slice-buffered *(ebp+0xc) *eax) # Function-name 6094 (write-buffered *(ebp+0xc) "'\n") @@ -6528,7 +6528,7 @@ if ('onhashchange' in window) { 6996 8d/copy-address *(esi+ebx+0xc) 3/r32/ebx 6997 { 6998 #? (write-buffered Stderr " ") - 6999 #? (print-int32-buffered Stderr %ecx) + 6999 #? (write-int32-hex-buffered Stderr %ecx) 7000 #? (write-buffered Stderr "\n") 7001 #? (flush Stderr) 7002 # if (curr >= max) return -1 @@ -6550,7 +6550,7 @@ if ('onhashchange' in window) { 7018 89/<- %eax 1/r32/ecx 7019 $pos-slice:end: 7020 #? (write-buffered Stderr "=> ") - 7021 #? (print-int32-buffered Stderr %eax) + 7021 #? (write-int32-hex-buffered Stderr %eax) 7022 #? (write-buffered Stderr "\n") 7023 # . restore registers 7024 5e/pop-to-esi @@ -7349,7 +7349,7 @@ if ('onhashchange' in window) { 7817 (write %edx "$") 7818 (write %edx %eax) 7819 (write %edx ":") - 7820 (print-int32 %edx *Next-block-index) + 7820 (write-int32-hex %edx *Next-block-index) 7821 ff 0/subop/increment *Next-block-index 7822 # var s/eax: slice = {name->data, name->data + name->write} (clobbering edx) 7823 # . eax = name->write @@ -7366,9 +7366,9 @@ if ('onhashchange' in window) { 7834 (new-literal Heap %eax *(ebp+0xc)) 7835 #? 8b/-> *(ebp+0xc) 0/r32/eax 7836 #? (write-buffered Stderr "type allocid in caller after new-literal: ") - 7837 #? (print-int32-buffered Stderr *(eax+8)) + 7837 #? (write-int32-hex-buffered Stderr *(eax+8)) 7838 #? (write-buffered Stderr " for var ") - 7839 #? (print-int32-buffered Stderr %eax) + 7839 #? (write-int32-hex-buffered Stderr %eax) 7840 #? (write-buffered Stderr Newline) 7841 #? (flush Stderr) 7842 $new-block-name:end: @@ -7883,7 +7883,7 @@ if ('onhashchange' in window) { 8351 (lookup-or-create-constant %eax %ecx %esi) 8352 #? (lookup *esi *(esi+4)) 8353 #? (write-buffered Stderr "creating new output var ") - 8354 #? (print-int32-buffered Stderr %eax) + 8354 #? (write-int32-hex-buffered Stderr %eax) 8355 #? (write-buffered Stderr " for field called ") 8356 #? (write-slice-buffered Stderr %ecx) 8357 #? (write-buffered Stderr "; var name ") @@ -8010,7 +8010,7 @@ if ('onhashchange' in window) { 8478 81 4/subop/and %ecx 0xff/imm32 8479 # if is-decimal-digit?(c) return new var(name) 8480 { - 8481 (is-decimal-digit? %ecx) # => eax + 8481 (is-decimal-digit? %ecx) # => eax 8482 3d/compare-eax-and 0/imm32/false 8483 74/jump-if-= break/disp8 8484 $lookup-var-or-literal:literal: @@ -8640,7 +8640,7 @@ if ('onhashchange' in window) { 9108 #? (write-buffered Stderr " at ") 9109 #? 8b/-> *(ebp+0x14) 1/r32/ecx 9110 #? (lookup *ecx *(ecx+4)) # => eax - 9111 #? (print-int32-buffered Stderr %eax) + 9111 #? (write-int32-hex-buffered Stderr %eax) 9112 #? (write-buffered Stderr Newline) 9113 #? (flush Stderr) 9114 $new-var:end: @@ -8986,14 +8986,14 @@ if ('onhashchange' in window) { 9454 #? 8b/-> *(ebp+0x10) 0/r32/eax 9455 #? (write-buffered Stderr "@") 9456 #? (lookup *eax *(eax+4)) - 9457 #? (print-int32-buffered Stderr %eax) + 9457 #? (write-int32-hex-buffered Stderr %eax) 9458 #? (lookup *eax *(eax+4)) 9459 #? (write-buffered Stderr %eax) 9460 #? (write-buffered Stderr Newline) 9461 #? (flush Stderr) 9462 #? (write-buffered Stderr "offset: ") 9463 #? 8b/-> *(eax+0x14) 0/r32/eax - 9464 #? (print-int32-buffered Stderr %eax) + 9464 #? (write-int32-hex-buffered Stderr %eax) 9465 #? (write-buffered Stderr Newline) 9466 #? (flush Stderr) 9467 $lookup-or-create-constant:end: @@ -9075,9 +9075,9 @@ if ('onhashchange' in window) { 9543 # var tmp/eax: (addr typeinfo) = lookup(*out) 9544 (lookup *edi *(edi+4)) # => eax 9545 #? (write-buffered Stderr "created typeinfo at ") - 9546 #? (print-int32-buffered Stderr %eax) + 9546 #? (write-int32-hex-buffered Stderr %eax) 9547 #? (write-buffered Stderr " for type-id ") - 9548 #? (print-int32-buffered Stderr *(ebp+8)) + 9548 #? (write-int32-hex-buffered Stderr *(ebp+8)) 9549 #? (write-buffered Stderr Newline) 9550 #? (flush Stderr) 9551 # tmp->id = t @@ -9251,18 +9251,18 @@ if ('onhashchange' in window) { 9719 75/jump-if-!= break/disp8 9720 (allocate Heap *Typeinfo-entry-size %esi) 9721 #? (write-buffered Stderr "handle at ") - 9722 #? (print-int32-buffered Stderr %esi) + 9722 #? (write-int32-hex-buffered Stderr %esi) 9723 #? (write-buffered Stderr ": ") - 9724 #? (print-int32-buffered Stderr *esi) + 9724 #? (write-int32-hex-buffered Stderr *esi) 9725 #? (write-buffered Stderr " ") - 9726 #? (print-int32-buffered Stderr *(esi+4)) + 9726 #? (write-int32-hex-buffered Stderr *(esi+4)) 9727 #? (write-buffered Stderr Newline) 9728 #? (flush Stderr) 9729 #? (lookup *esi *(esi+4)) 9730 #? (write-buffered Stderr "created typeinfo fields at ") - 9731 #? (print-int32-buffered Stderr %esi) + 9731 #? (write-int32-hex-buffered Stderr %esi) 9732 #? (write-buffered Stderr " for ") - 9733 #? (print-int32-buffered Stderr *(ebp+8)) + 9733 #? (write-int32-hex-buffered Stderr *(ebp+8)) 9734 #? (write-buffered Stderr Newline) 9735 #? (flush Stderr) 9736 } @@ -9371,9 +9371,9 @@ if ('onhashchange' in window) { 9844 (lookup *ebx *(ebx+4)) # => eax 9845 8b/-> *(ebp-4) 1/r32/ecx 9846 #? (write-buffered Stderr "saving index ") - 9847 #? (print-int32-buffered Stderr %ecx) + 9847 #? (write-int32-hex-buffered Stderr %ecx) 9848 #? (write-buffered Stderr " at ") - 9849 #? (print-int32-buffered Stderr %edi) + 9849 #? (write-int32-hex-buffered Stderr %edi) 9850 #? (write-buffered Stderr Newline) 9851 #? (flush Stderr) 9852 89/<- *(eax+8) 1/r32/ecx # Typeinfo-entry-index @@ -9691,9 +9691,9 @@ if ('onhashchange' in window) { 10164 39/compare %ebx 2/r32/edx 10165 0f 8d/jump-if->= break/disp32 10166 #? (write-buffered Stderr "looking up index ") -10167 #? (print-int32-buffered Stderr %ebx) +10167 #? (write-int32-hex-buffered Stderr %ebx) 10168 #? (write-buffered Stderr " in ") -10169 #? (print-int32-buffered Stderr *(ebp+8)) +10169 #? (write-int32-hex-buffered Stderr *(ebp+8)) 10170 #? (write-buffered Stderr Newline) 10171 #? (flush Stderr) 10172 # var v/esi: (addr typeinfo-entry) @@ -9756,9 +9756,9 @@ if ('onhashchange' in window) { 10229 # if (v->index == idx) return v 10230 8b/-> *(eax+8) 3/r32/ebx # Typeinfo-entry-index 10231 #? (write-buffered Stderr "comparing ") -10232 #? (print-int32-buffered Stderr %ebx) +10232 #? (write-int32-hex-buffered Stderr %ebx) 10233 #? (write-buffered Stderr " and ") -10234 #? (print-int32-buffered Stderr *(ebp+0xc)) +10234 #? (write-int32-hex-buffered Stderr *(ebp+0xc)) 10235 #? (write-buffered Stderr Newline) 10236 #? (flush Stderr) 10237 39/compare *(ebp+0xc) 3/r32/ebx @@ -9772,7 +9772,7 @@ if ('onhashchange' in window) { 10245 b8/copy-to-eax 0/imm32 10246 $locate-typeinfo-entry-with-index:end: 10247 #? (write-buffered Stderr "returning ") -10248 #? (print-int32-buffered Stderr %eax) +10248 #? (write-int32-hex-buffered Stderr %eax) 10249 #? (write-buffered Stderr Newline) 10250 #? (flush Stderr) 10251 # . restore registers @@ -9833,22 +9833,22 @@ if ('onhashchange' in window) { 10306 (lookup *(esi+4) *(esi+8)) # Typeinfo-fields Typeinfo-fields => eax 10307 89/<- %ecx 0/r32/eax 10308 (write-buffered Stderr "id:") -10309 (print-int32-buffered Stderr *esi) +10309 (write-int32-hex-buffered Stderr *esi) 10310 (write-buffered Stderr "\n") 10311 (write-buffered Stderr "fields @ ") -10312 (print-int32-buffered Stderr %ecx) +10312 (write-int32-hex-buffered Stderr %ecx) 10313 (write-buffered Stderr Newline) 10314 (flush Stderr) 10315 (write-buffered Stderr " write: ") -10316 (print-int32-buffered Stderr *ecx) +10316 (write-int32-hex-buffered Stderr *ecx) 10317 (write-buffered Stderr Newline) 10318 (flush Stderr) 10319 (write-buffered Stderr " read: ") -10320 (print-int32-buffered Stderr *(ecx+4)) +10320 (write-int32-hex-buffered Stderr *(ecx+4)) 10321 (write-buffered Stderr Newline) 10322 (flush Stderr) 10323 (write-buffered Stderr " size: ") -10324 (print-int32-buffered Stderr *(ecx+8)) +10324 (write-int32-hex-buffered Stderr *(ecx+8)) 10325 (write-buffered Stderr Newline) 10326 (flush Stderr) 10327 # var table-size/edx: int = table->write @@ -9864,30 +9864,30 @@ if ('onhashchange' in window) { 10337 0f 83/jump-if-addr>= break/disp32 10338 (write-buffered Stderr " row:\n") 10339 (write-buffered Stderr " key: ") -10340 (print-int32-buffered Stderr *ecx) +10340 (write-int32-hex-buffered Stderr *ecx) 10341 (write-buffered Stderr ",") -10342 (print-int32-buffered Stderr *(ecx+4)) +10342 (write-int32-hex-buffered Stderr *(ecx+4)) 10343 (write-buffered Stderr " = '") 10344 (lookup *ecx *(ecx+4)) 10345 (write-buffered Stderr %eax) 10346 (write-buffered Stderr "' @ ") -10347 (print-int32-buffered Stderr %eax) +10347 (write-int32-hex-buffered Stderr %eax) 10348 (write-buffered Stderr Newline) 10349 (flush Stderr) 10350 (write-buffered Stderr " value: ") -10351 (print-int32-buffered Stderr *(ecx+8)) +10351 (write-int32-hex-buffered Stderr *(ecx+8)) 10352 (write-buffered Stderr ",") -10353 (print-int32-buffered Stderr *(ecx+0xc)) +10353 (write-int32-hex-buffered Stderr *(ecx+0xc)) 10354 (write-buffered Stderr " = typeinfo-entry@") 10355 (lookup *(ecx+8) *(ecx+0xc)) -10356 (print-int32-buffered Stderr %eax) +10356 (write-int32-hex-buffered Stderr %eax) 10357 (write-buffered Stderr Newline) 10358 (flush Stderr) 10359 (write-buffered Stderr " input var@") 10360 (dump-var 5 %eax) 10361 (lookup *(ecx+8) *(ecx+0xc)) 10362 (write-buffered Stderr " index: ") -10363 (print-int32-buffered Stderr *(eax+8)) +10363 (write-int32-hex-buffered Stderr *(eax+8)) 10364 (write-buffered Stderr Newline) 10365 (flush Stderr) 10366 (write-buffered Stderr " output var@") @@ -9922,12 +9922,12 @@ if ('onhashchange' in window) { 10395 # eax = v 10396 8b/-> *(ebp+0xc) 0/r32/eax 10397 # -10398 (print-int32-buffered Stderr *eax) +10398 (write-int32-hex-buffered Stderr *eax) 10399 (write-buffered Stderr ",") -10400 (print-int32-buffered Stderr *(eax+4)) +10400 (write-int32-hex-buffered Stderr *(eax+4)) 10401 (write-buffered Stderr "->") 10402 (lookup *eax *(eax+4)) -10403 (print-int32-buffered Stderr %eax) +10403 (write-int32-hex-buffered Stderr %eax) 10404 (write-buffered Stderr Newline) 10405 (flush Stderr) 10406 { @@ -9936,12 +9936,12 @@ if ('onhashchange' in window) { 10409 (emit-indent Stderr *(ebp+8)) 10410 (write-buffered Stderr "name: ") 10411 89/<- %ebx 0/r32/eax -10412 (print-int32-buffered Stderr *ebx) # Var-name +10412 (write-int32-hex-buffered Stderr *ebx) # Var-name 10413 (write-buffered Stderr ",") -10414 (print-int32-buffered Stderr *(ebx+4)) # Var-name +10414 (write-int32-hex-buffered Stderr *(ebx+4)) # Var-name 10415 (write-buffered Stderr "->") 10416 (lookup *ebx *(ebx+4)) # Var-name -10417 (print-int32-buffered Stderr %eax) +10417 (write-int32-hex-buffered Stderr %eax) 10418 { 10419 3d/compare-eax-and 0/imm32 10420 74/jump-if-= break/disp8 @@ -9952,23 +9952,23 @@ if ('onhashchange' in window) { 10425 (flush Stderr) 10426 (emit-indent Stderr *(ebp+8)) 10427 (write-buffered Stderr "block depth: ") -10428 (print-int32-buffered Stderr *(ebx+0x10)) # Var-block-depth +10428 (write-int32-hex-buffered Stderr *(ebx+0x10)) # Var-block-depth 10429 (write-buffered Stderr Newline) 10430 (flush Stderr) 10431 (emit-indent Stderr *(ebp+8)) 10432 (write-buffered Stderr "stack offset: ") -10433 (print-int32-buffered Stderr *(ebx+0x14)) # Var-offset +10433 (write-int32-hex-buffered Stderr *(ebx+0x14)) # Var-offset 10434 (write-buffered Stderr Newline) 10435 (flush Stderr) 10436 (emit-indent Stderr *(ebp+8)) 10437 (write-buffered Stderr "reg: ") -10438 (print-int32-buffered Stderr *(ebx+0x18)) # Var-register +10438 (write-int32-hex-buffered Stderr *(ebx+0x18)) # Var-register 10439 (write-buffered Stderr ",") -10440 (print-int32-buffered Stderr *(ebx+0x1c)) # Var-register +10440 (write-int32-hex-buffered Stderr *(ebx+0x1c)) # Var-register 10441 (write-buffered Stderr "->") 10442 (flush Stderr) 10443 (lookup *(ebx+0x18) *(ebx+0x1c)) # Var-register -10444 (print-int32-buffered Stderr %eax) +10444 (write-int32-hex-buffered Stderr %eax) 10445 { 10446 3d/compare-eax-and 0/imm32 10447 74/jump-if-= break/disp8 @@ -11151,10 +11151,10 @@ if ('onhashchange' in window) { 11624 # var t/ecx: (addr tree type-id) = lookup(v->type) 11625 8b/-> *(ebp+8) 1/r32/ecx 11626 #? (write-buffered Stderr "size-of ") -11627 #? (print-int32-buffered Stderr %ecx) +11627 #? (write-int32-hex-buffered Stderr %ecx) 11628 #? (write-buffered Stderr Newline) 11629 #? (write-buffered Stderr "type allocid: ") -11630 #? (print-int32-buffered Stderr *(ecx+8)) +11630 #? (write-int32-hex-buffered Stderr *(ecx+8)) 11631 #? (write-buffered Stderr Newline) 11632 #? (flush Stderr) 11633 (lookup *(ecx+8) *(ecx+0xc)) # Var-type Var-type => eax @@ -11506,9 +11506,9 @@ if ('onhashchange' in window) { 11979 #? (write-buffered Stderr "setting offset of fn inout ") 11980 #? (write-buffered Stderr %eax) 11981 #? (write-buffered Stderr "@") -11982 #? (print-int32-buffered Stderr %ebx) +11982 #? (write-int32-hex-buffered Stderr %ebx) 11983 #? (write-buffered Stderr " to ") -11984 #? (print-int32-buffered Stderr %edx) +11984 #? (write-int32-hex-buffered Stderr %edx) 11985 #? (write-buffered Stderr Newline) 11986 #? (flush Stderr) 11987 # v->offset = next-offset @@ -11648,7 +11648,7 @@ if ('onhashchange' in window) { 12217 #? (lookup *ecx *(ecx+4)) 12218 #? (write-buffered Stderr %eax) 12219 #? (write-buffered Stderr " at depth ") -12220 #? (print-int32-buffered Stderr *(ecx+0x10)) +12220 #? (write-int32-hex-buffered Stderr *(ecx+0x10)) 12221 #? (write-buffered Stderr Newline) 12222 #? (flush Stderr) 12223 # ensure that v is in a register @@ -11956,7 +11956,7 @@ if ('onhashchange' in window) { 12525 $emit-cleanup-code-until-depth:reclaim-var-on-stack: 12526 (emit-indent *(ebp+8) *Curr-block-depth) 12527 (write-buffered *(ebp+8) "81 0/subop/add %esp ") -12528 (print-int32-buffered *(ebp+8) %eax) +12528 (write-int32-hex-buffered *(ebp+8) %eax) 12529 (write-buffered *(ebp+8) "/imm32\n") 12530 } 12531 $emit-cleanup-code-until-depth:continue: @@ -12037,7 +12037,7 @@ if ('onhashchange' in window) { 12606 # 12607 (emit-indent *(ebp+8) *Curr-block-depth) 12608 (write-buffered *(ebp+8) "81 0/subop/add %esp ") -12609 (print-int32-buffered *(ebp+8) %eax) +12609 (write-int32-hex-buffered *(ebp+8) %eax) 12610 (write-buffered *(ebp+8) "/imm32\n") 12611 } 12612 $emit-cleanup-code-until-target:continue: @@ -12575,11 +12575,11 @@ if ('onhashchange' in window) { 13144 81 5/subop/subtract %edx 4/imm32 13145 (emit-indent *(ebp+8) *Curr-block-depth) 13146 (write-buffered *(ebp+8) "(push-n-zero-bytes ") -13147 (print-int32-buffered *(ebp+8) %edx) +13147 (write-int32-hex-buffered *(ebp+8) %edx) 13148 (write-buffered *(ebp+8) ")\n") 13149 (emit-indent *(ebp+8) *Curr-block-depth) 13150 (write-buffered *(ebp+8) "68/push ") -13151 (print-int32-buffered *(ebp+8) %edx) +13151 (write-int32-hex-buffered *(ebp+8) %edx) 13152 (write-buffered *(ebp+8) "/imm32\n") 13153 eb/jump $emit-subx-var-def:end/disp8 13154 } @@ -12750,7 +12750,7 @@ if ('onhashchange' in window) { 13319 (write-buffered *(ebp+8) "31/xor %edx 2/r32/edx\n") 13320 (emit-indent *(ebp+8) *Curr-block-depth) 13321 (write-buffered *(ebp+8) "b9/copy-to-ecx ") -13322 (print-int32-buffered *(ebp+8) %ecx) +13322 (write-int32-hex-buffered *(ebp+8) %ecx) 13323 (write-buffered *(ebp+8) "/imm32\n") 13324 (emit-indent *(ebp+8) *Curr-block-depth) 13325 (write-buffered *(ebp+8) "f7 7/subop/idiv-eax-edx-by %ecx\n") @@ -12857,13 +12857,13 @@ if ('onhashchange' in window) { 13426 74/jump-if-= break/disp8 13427 $emit-save-size-to:emit-base-from-stack: 13428 (write-buffered *(ebp+8) "(ebp+") -13429 (print-int32-buffered *(ebp+8) *(ebx+0x14)) # Var-offset +13429 (write-int32-hex-buffered *(ebp+8) *(ebx+0x14)) # Var-offset 13430 (write-buffered *(ebp+8) ")") 13431 } 13432 $emit-save-size-to:emit-output: 13433 (write-buffered *(ebp+8) " ") 13434 (get Mu-registers *(ebp+0x10) 0xc "Mu-registers") # => eax -13435 (print-int32-buffered *(ebp+8) *eax) +13435 (write-int32-hex-buffered *(ebp+8) *eax) 13436 (write-buffered *(ebp+8) "/r32\n") 13437 $emit-save-size-to:end: 13438 # . restore registers @@ -12886,7 +12886,7 @@ if ('onhashchange' in window) { 13455 (write-buffered *(ebp+8) *(ebp+0xc)) 13456 (write-buffered *(ebp+8) Space) 13457 (num-shift-rights *(ebp+0x10)) # => eax -13458 (print-int32-buffered *(ebp+8) %eax) +13458 (write-int32-hex-buffered *(ebp+8) %eax) 13459 (write-buffered *(ebp+8) "/imm8\n") 13460 $emit-divide-by-shift-right:end: 13461 # . restore registers @@ -12994,7 +12994,7 @@ if ('onhashchange' in window) { 13563 # TODO: ensure size is a power of 2 13564 (array-element-size %ebx *(ebp+0x10) *(ebp+0x14)) # => eax 13565 (num-shift-rights %eax) # => eax -13566 (print-int32-buffered *(ebp+8) %eax) +13566 (write-int32-hex-buffered *(ebp+8) %eax) 13567 e9/jump $translate-mu-index-stmt-with-array-in-register:emit-register-index-done/disp32 13568 } 13569 # if index->type is any other atom, abort @@ -13034,7 +13034,7 @@ if ('onhashchange' in window) { 13603 05/add-to-eax 4/imm32 13604 # TODO: check edx for overflow 13605 # print offset -13606 (print-int32-buffered *(ebp+8) %eax) +13606 (write-int32-hex-buffered *(ebp+8) %eax) 13607 (write-buffered *(ebp+8) ") ") 13608 e9/jump $translate-mu-index-stmt-with-array-in-register:emit-output/disp32 13609 } @@ -13047,7 +13047,7 @@ if ('onhashchange' in window) { 13616 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax 13617 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax 13618 (get Mu-registers %eax 0xc "Mu-registers") # => eax: (addr int) -13619 (print-int32-buffered *(ebp+8) *eax) +13619 (write-int32-hex-buffered *(ebp+8) *eax) 13620 (write-buffered *(ebp+8) "/r32\n") 13621 $translate-mu-index-stmt-with-array-in-register:end: 13622 # . restore registers @@ -13105,13 +13105,13 @@ if ('onhashchange' in window) { 13674 # TODO: ensure size is a power of 2 13675 (array-element-size %ecx *(ebp+0x10) *(ebp+0x14)) # => eax 13676 (num-shift-rights %eax) # => eax -13677 (print-int32-buffered *(ebp+8) %eax) +13677 (write-int32-hex-buffered *(ebp+8) %eax) 13678 # 13679 (write-buffered *(ebp+8) " + ") 13680 # 13681 8b/-> *(ecx+0x14) 0/r32/eax # Var-offset 13682 05/add-to-eax 4/imm32 # for array length -13683 (print-int32-buffered *(ebp+8) %eax) +13683 (write-int32-hex-buffered *(ebp+8) %eax) 13684 e9/jump $translate-mu-index-stmt-with-array-on-stack:emit-register-index-done/disp32 13685 } 13686 # if index->type is any other atom, abort @@ -13153,7 +13153,7 @@ if ('onhashchange' in window) { 13722 05/add-to-eax 4/imm32 13723 # TODO: check edx for overflow 13724 # print offset -13725 (print-int32-buffered *(ebp+8) %eax) +13725 (write-int32-hex-buffered *(ebp+8) %eax) 13726 (write-buffered *(ebp+8) ") ") 13727 e9/jump $translate-mu-index-stmt-with-array-on-stack:emit-output/disp32 13728 } @@ -13166,7 +13166,7 @@ if ('onhashchange' in window) { 13735 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax 13736 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax 13737 (get Mu-registers %eax 0xc "Mu-registers") # => eax: (addr int) -13738 (print-int32-buffered *(ebp+8) *eax) +13738 (write-int32-hex-buffered *(ebp+8) *eax) 13739 (write-buffered *(ebp+8) "/r32\n") 13740 $translate-mu-index-stmt-with-array-on-stack:end: 13741 # . restore registers @@ -13206,7 +13206,7 @@ if ('onhashchange' in window) { 13775 89/<- %ebx 0/r32/eax 13776 # print array-element-size(base) 13777 (array-element-size %ebx *(ebp+0x10) *(ebp+0x14)) # => eax -13778 (print-int32-buffered *(ebp+8) %eax) +13778 (write-int32-hex-buffered *(ebp+8) %eax) 13779 (write-buffered *(ebp+8) "/imm32 ") 13780 $translate-mu-compute-index-stmt:emit-output: 13781 # outputs[0] "/r32" @@ -13214,7 +13214,7 @@ if ('onhashchange' in window) { 13783 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax 13784 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax 13785 (get Mu-registers %eax 0xc "Mu-registers") # => eax: (addr int) -13786 (print-int32-buffered *(ebp+8) *eax) +13786 (write-int32-hex-buffered *(ebp+8) *eax) 13787 (write-buffered *(ebp+8) "/r32\n") 13788 $translate-mu-compute-index-stmt:end: 13789 # . restore registers @@ -13256,7 +13256,7 @@ if ('onhashchange' in window) { 13825 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax 13826 (write-buffered *(ebp+8) %eax) 13827 (write-buffered *(ebp+8) " + ") -13828 (print-int32-buffered *(ebp+8) %edx) +13828 (write-int32-hex-buffered *(ebp+8) %edx) 13829 (write-buffered *(ebp+8) ") ") 13830 e9/jump $translate-mu-get-stmt:emit-output/disp32 13831 } @@ -13266,7 +13266,7 @@ if ('onhashchange' in window) { 13835 # emit "*(ebp + " inouts[0]->stack-offset + offset ") " 13836 (write-buffered *(ebp+8) "*(ebp+") 13837 03/add *(eax+0x14) 2/r32/edx # Var-offset -13838 (print-int32-buffered *(ebp+8) %edx) +13838 (write-int32-hex-buffered *(ebp+8) %edx) 13839 (write-buffered *(ebp+8) ") ") 13840 eb/jump $translate-mu-get-stmt:emit-output/disp8 13841 } @@ -13277,7 +13277,7 @@ if ('onhashchange' in window) { 13846 # emit offset->register "/r32" 13847 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax 13848 (get Mu-registers %eax 0xc "Mu-registers") # => eax: (addr int) -13849 (print-int32-buffered *(ebp+8) *eax) +13849 (write-int32-hex-buffered *(ebp+8) *eax) 13850 (write-buffered *(ebp+8) "/r32\n") 13851 $translate-mu-get-stmt:end: 13852 # . restore registers @@ -13369,7 +13369,7 @@ if ('onhashchange' in window) { 13938 (write-buffered *(ebp+0xc) %eax) 13939 58/pop-to-eax 13940 (write-buffered *(ebp+0xc) "' has atomic type ") -13941 (print-int32-buffered *(ebp+0xc) *(eax+4)) # Tree-value +13941 (write-int32-hex-buffered *(ebp+0xc) *(eax+4)) # Tree-value 13942 (write-buffered *(ebp+0xc) Newline) 13943 (flush *(ebp+0xc)) 13944 (stop *(ebp+0x10) 1) @@ -13455,7 +13455,7 @@ if ('onhashchange' in window) { 14024 # var output-var/eax: (addr var) = second-inout->value 14025 (lookup *eax *(eax+4)) # Stmt-var-value Stmt-var-value => eax 14026 #? (write-buffered Stderr "mu-get-offset: ") -14027 #? (print-int32-buffered Stderr %eax) +14027 #? (write-int32-hex-buffered Stderr %eax) 14028 #? (write-buffered Stderr " name: ") 14029 #? 50/push-eax 14030 #? (lookup *eax *(eax+4)) # Var-name @@ -13466,7 +13466,7 @@ if ('onhashchange' in window) { 14035 # return output-var->stack-offset 14036 8b/-> *(eax+0x14) 0/r32/eax # Var-offset 14037 #? (write-buffered Stderr "=> ") -14038 #? (print-int32-buffered Stderr %eax) +14038 #? (write-int32-hex-buffered Stderr %eax) 14039 #? (write-buffered Stderr Newline) 14040 #? (flush Stderr) 14041 $emit-get-offset:end: @@ -16621,7 +16621,7 @@ if ('onhashchange' in window) { 17190 $get-stmt-operand-from-arg-location:abort: 17191 # error("invalid arg-location " eax) 17192 (write-buffered *(ebp+0x10) "invalid arg-location ") -17193 (print-int32-buffered *(ebp+0x10) %eax) +17193 (write-int32-hex-buffered *(ebp+0x10) %eax) 17194 (write-buffered *(ebp+0x10) Newline) 17195 (flush *(ebp+0x10)) 17196 (stop *(ebp+0x14) 1) @@ -16643,7 +16643,7 @@ if ('onhashchange' in window) { 17212 (lookup *(eax+0x18) *(eax+0x1c)) # Var-register Var-register => eax 17213 (maybe-get Mu-registers %eax 0xc) # => eax: (addr register-index) 17214 (write-buffered *(ebp+8) Space) -17215 (print-int32-buffered *(ebp+8) *eax) +17215 (write-int32-hex-buffered *(ebp+8) *eax) 17216 (write-buffered *(ebp+8) "/r32") 17217 $emit-subx-r32:end: 17218 # . restore registers @@ -16857,7 +16857,7 @@ if ('onhashchange' in window) { 17426 (write-buffered *(ebp+8) " *(") 17427 (write-buffered *(ebp+8) %esi) 17428 (write-buffered *(ebp+8) "+") -17429 (print-int32-buffered *(ebp+8) %eax) +17429 (write-int32-hex-buffered *(ebp+8) %eax) 17430 (write-buffered *(ebp+8) ")") 17431 # i += 4 17432 05/add-to-eax 4/imm32 @@ -16897,7 +16897,7 @@ if ('onhashchange' in window) { 17466 7d/jump-if->= break/disp8 17467 # emit " *(ebp+" curr ")" 17468 (write-buffered *(ebp+8) " *(ebp+") -17469 (print-int32-buffered *(ebp+8) %ecx) +17469 (write-int32-hex-buffered *(ebp+8) %ecx) 17470 (write-buffered *(ebp+8) ")") 17471 # i += 4 17472 81 0/subop/add %ecx 4/imm32 @@ -16960,7 +16960,7 @@ if ('onhashchange' in window) { 17529 $emit-subx-var-as-rm32:stack: 17530 (write-buffered *(ebp+8) Space) 17531 (write-buffered *(ebp+8) "*(ebp+") -17532 (print-int32-buffered *(ebp+8) *(esi+0x14)) # Var-offset +17532 (write-int32-hex-buffered *(ebp+8) *(esi+0x14)) # Var-offset 17533 (write-buffered *(ebp+8) ")") 17534 } 17535 $emit-subx-var-as-rm32:end: diff --git a/html/apps/parse-int.mu.html b/html/apps/parse-int.mu.html index 57bf7b3a..68bc12a7 100644 --- a/html/apps/parse-int.mu.html +++ b/html/apps/parse-int.mu.html @@ -72,7 +72,7 @@ if ('onhashchange' in window) { 14 compare n, 1 15 { 16 break-if-> -17 print-string "usage: parse-int <integer>\n" +17 print-string-to-screen "usage: parse-int <integer>\n" 18 exit-status <- copy 1 19 break $main-body 20 } @@ -99,7 +99,7 @@ if ('onhashchange' in window) { 41 var c/eax: byte <- copy 0 42 c <- copy-byte *tmp 43 # -44 var digit/eax: int <- to-decimal-digit c +44 var digit/eax: int <- to-decimal-digit c 45 out <- add digit 46 i <- increment 47 loop diff --git a/html/apps/print-file.mu.html b/html/apps/print-file.mu.html index 80a2d04a..b567e515 100644 --- a/html/apps/print-file.mu.html +++ b/html/apps/print-file.mu.html @@ -72,7 +72,7 @@ if ('onhashchange' in window) { 14 compare n, 1 15 { 16 break-if-> -17 print-string "usage: cat <filename>\n" +17 print-string-to-screen "usage: cat <filename>\n" 18 break $main-body 19 } 20 { @@ -83,13 +83,13 @@ if ('onhashchange' in window) { 25 var addr-in/eax: (addr handle buffered-file) <- address in 26 open *filename, 0, addr-in 27 } -28 var _in-addr/eax: (addr buffered-file) <- lookup in +28 var _in-addr/eax: (addr buffered-file) <- lookup in 29 var in-addr/ecx: (addr buffered-file) <- copy _in-addr 30 { 31 var c/eax: byte <- read-byte-buffered in-addr 32 compare c, 0xffffffff # EOF marker 33 break-if-= -34 print-byte c +34 print-byte-to-screen c 35 loop 36 } 37 } diff --git a/html/apps/random.subx.html b/html/apps/random.subx.html index 62946701..bc570016 100644 --- a/html/apps/random.subx.html +++ b/html/apps/random.subx.html @@ -84,12 +84,12 @@ if ('onhashchange' in window) { 26 ba/copy-to-edx 4/imm32/size 27 e8/call syscall_read/disp32 28 -29 # print-int32-buffered(Stdout, *N) +29 # write-int32-hex-buffered(Stdout, *N) 30 # . . push args 31 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . N/disp32 # push *N 32 68/push Stdout/imm32 33 # . . call -34 e8/call print-int32-buffered/disp32 +34 e8/call write-int32-hex-buffered/disp32 35 36 # write-buffered(Stdout, Newline) 37 # . . push args diff --git a/html/apps/sigils.subx.html b/html/apps/sigils.subx.html index a8a31eae..b6ddf5ac 100644 --- a/html/apps/sigils.subx.html +++ b/html/apps/sigils.subx.html @@ -1223,12 +1223,12 @@ if ('onhashchange' in window) { 1423 e8/call write-buffered/disp32 1424 # . . discard args 1425 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -1426 # print-int32-buffered(out, *reg-num) +1426 # write-int32-hex-buffered(out, *reg-num) 1427 # . . push args 1428 ff 6/subop/push 0/mod/indirect 0/rm32/eax . . . . . . # push *eax 1429 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 1430 # . . call -1431 e8/call print-int32-buffered/disp32 +1431 e8/call write-int32-hex-buffered/disp32 1432 # . . discard args 1433 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 1434 # write-buffered(out, "/rm32") @@ -2292,12 +2292,12 @@ if ('onhashchange' in window) { 2542 e8/call write-buffered/disp32 2543 # . . discard args 2544 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -2545 # . print-int32-buffered(out, eax) +2545 # . write-int32-hex-buffered(out, eax) 2546 # . . push args 2547 50/push-eax 2548 68/push Stderr/imm32 2549 # . . call -2550 e8/call print-int32-buffered/disp32 +2550 e8/call write-int32-hex-buffered/disp32 2551 # . . discard args 2552 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2553 # . write-buffered(Stderr, "\n") @@ -2330,12 +2330,12 @@ if ('onhashchange' in window) { 2580 e8/call write-buffered/disp32 2581 # . . discard args 2582 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -2583 # . print-int32-buffered(out, eax) +2583 # . write-int32-hex-buffered(out, eax) 2584 # . . push args 2585 50/push-eax 2586 68/push Stderr/imm32 2587 # . . call -2588 e8/call print-int32-buffered/disp32 +2588 e8/call write-int32-hex-buffered/disp32 2589 # . . discard args 2590 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2591 # . write-buffered(Stderr, "\n") @@ -2368,12 +2368,12 @@ if ('onhashchange' in window) { 2618 e8/call write-buffered/disp32 2619 # . . discard args 2620 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -2621 # . print-int32-buffered(out, eax) +2621 # . write-int32-hex-buffered(out, eax) 2622 # . . push args 2623 50/push-eax 2624 68/push Stderr/imm32 2625 # . . call -2626 e8/call print-int32-buffered/disp32 +2626 e8/call write-int32-hex-buffered/disp32 2627 # . . discard args 2628 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2629 # . write-buffered(Stderr, "\n") @@ -2406,12 +2406,12 @@ if ('onhashchange' in window) { 2656 e8/call write-buffered/disp32 2657 # . . discard args 2658 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -2659 # . print-int32-buffered(out, eax) +2659 # . write-int32-hex-buffered(out, eax) 2660 # . . push args 2661 50/push-eax 2662 68/push Stderr/imm32 2663 # . . call -2664 e8/call print-int32-buffered/disp32 +2664 e8/call write-int32-hex-buffered/disp32 2665 # . . discard args 2666 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 2667 # . write-buffered(Stderr, "; expected ')' to wrap up\n") @@ -2941,12 +2941,12 @@ if ('onhashchange' in window) { 3191 e8/call write-buffered/disp32 3192 # . . discard args 3193 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -3194 # . print-int32-buffered(out, base) +3194 # . write-int32-hex-buffered(out, base) 3195 # . . push args 3196 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 3197 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3198 # . . call -3199 e8/call print-int32-buffered/disp32 +3199 e8/call write-int32-hex-buffered/disp32 3200 # . . discard args 3201 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3202 # . write-buffered(out, "/base ") @@ -2957,12 +2957,12 @@ if ('onhashchange' in window) { 3207 e8/call write-buffered/disp32 3208 # . . discard args 3209 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -3210 # . print-int32-buffered(out, index) +3210 # . write-int32-hex-buffered(out, index) 3211 # . . push args 3212 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) 3213 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3214 # . . call -3215 e8/call print-int32-buffered/disp32 +3215 e8/call write-int32-hex-buffered/disp32 3216 # . . discard args 3217 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3218 # . write-buffered(out, "/index ") @@ -2973,12 +2973,12 @@ if ('onhashchange' in window) { 3223 e8/call write-buffered/disp32 3224 # . . discard args 3225 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -3226 # . print-int32-buffered(out, scale) +3226 # . write-int32-hex-buffered(out, scale) 3227 # . . push args 3228 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 . # push *(ebp+20) 3229 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3230 # . . call -3231 e8/call print-int32-buffered/disp32 +3231 e8/call write-int32-hex-buffered/disp32 3232 # . . discard args 3233 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3234 # . write-buffered(out, "/scale ") @@ -2989,12 +2989,12 @@ if ('onhashchange' in window) { 3239 e8/call write-buffered/disp32 3240 # . . discard args 3241 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -3242 # . print-int32-buffered(out, disp) +3242 # . write-int32-hex-buffered(out, disp) 3243 # . . push args 3244 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 . # push *(ebp+24) 3245 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3246 # . . call -3247 e8/call print-int32-buffered/disp32 +3247 e8/call write-int32-hex-buffered/disp32 3248 # . . discard args 3249 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3250 # . write-buffered(out, "/disp32") @@ -3020,12 +3020,12 @@ if ('onhashchange' in window) { 3270 e8/call write-buffered/disp32 3271 # . . discard args 3272 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -3273 # . print-int32-buffered(out, base) +3273 # . write-int32-hex-buffered(out, base) 3274 # . . push args 3275 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 3276 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3277 # . . call -3278 e8/call print-int32-buffered/disp32 +3278 e8/call write-int32-hex-buffered/disp32 3279 # . . discard args 3280 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3281 # . write-buffered(out, "/rm32 ") @@ -3036,12 +3036,12 @@ if ('onhashchange' in window) { 3286 e8/call write-buffered/disp32 3287 # . . discard args 3288 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -3289 # . print-int32-buffered(out, disp) +3289 # . write-int32-hex-buffered(out, disp) 3290 # . . push args 3291 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 . # push *(ebp+24) 3292 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3293 # . . call -3294 e8/call print-int32-buffered/disp32 +3294 e8/call write-int32-hex-buffered/disp32 3295 # . . discard args 3296 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3297 # . write-buffered(out, "/disp32") @@ -3063,12 +3063,12 @@ if ('onhashchange' in window) { 3313 e8/call write-buffered/disp32 3314 # . . discard args 3315 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -3316 # . print-int32-buffered(out, base) +3316 # . write-int32-hex-buffered(out, base) 3317 # . . push args 3318 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 3319 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 3320 # . . call -3321 e8/call print-int32-buffered/disp32 +3321 e8/call write-int32-hex-buffered/disp32 3322 # . . discard args 3323 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3324 # . write-buffered(out, "/rm32") @@ -3703,12 +3703,12 @@ if ('onhashchange' in window) { 4128 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 4129 # . . restore eax 4130 58/pop-to-eax -4131 # . print-int32-buffered(Stderr, eax) +4131 # . write-int32-hex-buffered(Stderr, eax) 4132 # . . push args 4133 50/push-eax 4134 68/push Stderr/imm32 4135 # . . call -4136 e8/call print-int32-buffered/disp32 +4136 e8/call write-int32-hex-buffered/disp32 4137 # . . discard args 4138 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 4139 # . flush(Stderr) diff --git a/html/apps/subx-params.subx.html b/html/apps/subx-params.subx.html index 4aff3f56..2667f8db 100644 --- a/html/apps/subx-params.subx.html +++ b/html/apps/subx-params.subx.html @@ -66,11 +66,11 @@ if ('onhashchange' in window) { 12 13 # number of labels we can translate to addresses 14 Max-labels: -15 0x30000/imm32/8K-labels/192KB +15 0x30000/imm32/24K-labels/192KB 16 17 # capacity of trace-stream 18 Trace-size: -19 0x100000/imm32/1MB +19 0x200000/imm32/2MB diff --git a/html/apps/survey.subx.html b/html/apps/survey.subx.html index 9da2f7ad..da2a899f 100644 --- a/html/apps/survey.subx.html +++ b/html/apps/survey.subx.html @@ -407,7 +407,7 @@ if ('onhashchange' in window) { 369 # . check-trace-contains("segment 'code' has size 0x00000005.", msg) 370 # . . push args 371 68/push "F - test-subx-survey-computes-addresses/2"/imm32 - 372 68/push "segment 'code' has size 0x00000005."/imm32 + 372 68/push "segment 'code' has size 0x00000005."/imm32 373 # . . call 374 e8/call check-trace-contains/disp32 375 # . . discard args @@ -1001,7 +1001,7 @@ if ('onhashchange' in window) { 1060 # . check-trace-contains("segment 'code' has size 0x00000005", msg) 1061 # . . push args 1062 68/push "F - test-compute-offsets/1"/imm32 -1063 68/push "segment 'code' has size 0x00000005."/imm32 +1063 68/push "segment 'code' has size 0x00000005."/imm32 1064 # . . call 1065 e8/call check-trace-contains/disp32 1066 # . . discard args @@ -1017,7 +1017,7 @@ if ('onhashchange' in window) { 1076 # . check-trace-contains("segment 'data' has size 0x00000002.", msg) 1077 # . . push args 1078 68/push "F - test-compute-offsets/3"/imm32 -1079 68/push "segment 'data' has size 0x00000002."/imm32 +1079 68/push "segment 'data' has size 0x00000002."/imm32 1080 # . . call 1081 e8/call check-trace-contains/disp32 1082 # . . discard args @@ -3134,12 +3134,12 @@ if ('onhashchange' in window) { 3628 e8/call write/disp32 3629 # . . discard args 3630 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -3631 # print-int32(*Trace-stream, n4) +3631 # write-int32-hex(*Trace-stream, n4) 3632 # . . push args 3633 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 . # push *(ebp+20) 3634 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3635 # . . call -3636 e8/call print-int32/disp32 +3636 e8/call write-int32-hex/disp32 3637 # . . discard args 3638 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3639 # trace(s5) # implicitly adds a newline and finalizes the trace line @@ -3200,12 +3200,12 @@ if ('onhashchange' in window) { 3719 e8/call write/disp32 3720 # . . discard args 3721 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -3722 # print-int32(*Trace-stream, n2) +3722 # write-int32-hex(*Trace-stream, n2) 3723 # . . push args 3724 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) 3725 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3726 # . . call -3727 e8/call print-int32/disp32 +3727 e8/call write-int32-hex/disp32 3728 # . . discard args 3729 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3730 # write(*Trace-stream, s3) @@ -3216,12 +3216,12 @@ if ('onhashchange' in window) { 3735 e8/call write/disp32 3736 # . . discard args 3737 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -3738 # print-int32(*Trace-stream, n4) +3738 # write-int32-hex(*Trace-stream, n4) 3739 # . . push args 3740 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 . # push *(ebp+20) 3741 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3742 # . . call -3743 e8/call print-int32/disp32 +3743 e8/call write-int32-hex/disp32 3744 # . . discard args 3745 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3746 # trace(s5) # implicitly adds a newline and finalizes the trace line @@ -3398,12 +3398,12 @@ if ('onhashchange' in window) { 3967 e8/call write/disp32 3968 # . . discard args 3969 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -3970 # print-int32(*Trace-stream, n4) +3970 # write-int32-hex(*Trace-stream, n4) 3971 # . . push args 3972 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 . # push *(ebp+20) 3973 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream 3974 # . . call -3975 e8/call print-int32/disp32 +3975 e8/call write-int32-hex/disp32 3976 # . . discard args 3977 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 3978 # trace(s5) # implicitly adds a newline and finalizes the trace line diff --git a/html/apps/tui.mu.html b/html/apps/tui.mu.html index e53f52b4..ac24ee9a 100644 --- a/html/apps/tui.mu.html +++ b/html/apps/tui.mu.html @@ -67,26 +67,26 @@ if ('onhashchange' in window) { 9 var ncols/ecx: int <- copy 0 10 nrows, ncols <- screen-size 11 enable-screen-grid-mode -12 move-cursor 5, 35 -13 start-color 1, 0x7a -14 start-blinking -15 print-string "Hello world!" -16 reset-formatting -17 move-cursor 6, 35 -18 print-string "tty dimensions: " -19 print-int32-to-screen nrows -20 print-string " rows, " -21 print-int32-to-screen ncols -22 print-string " rows\n" +12 move-cursor-on-screen 5, 35 +13 start-color-on-screen 1, 0x7a +14 start-blinking-on-screen +15 print-string-to-screen "Hello world!" +16 reset-formatting-on-screen +17 move-cursor-on-screen 6, 35 +18 print-string-to-screen "tty dimensions: " +19 print-int32-to-screen nrows +20 print-string-to-screen " rows, " +21 print-int32-to-screen ncols +22 print-string-to-screen " rows\n" 23 -24 print-string "press a key to see its code: " +24 print-string-to-screen "press a key to see its code: " 25 enable-keyboard-immediate-mode 26 var x/eax: byte <- read-key 27 enable-keyboard-type-mode 28 enable-screen-type-mode -29 print-string "You pressed " -30 print-int32-to-screen x -31 print-string "\n" +29 print-string-to-screen "You pressed " +30 print-int32-to-screen x +31 print-string-to-screen "\n" 32 exit-status <- copy 0 33 }