about summary refs log tree commit diff stats
path: root/subx/051test.subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-11-30 11:10:44 -0800
committerKartik Agaram <vc@akkartik.com>2018-11-30 11:13:36 -0800
commitee9a9237d6324f1de1bb7150083eacf7b9af5f70 (patch)
tree86180456f2a3cf5503783afc78856280f088a863 /subx/051test.subx
parent6030d7e2e56d445ca67c6a0e8c9cf33e46bc673c (diff)
downloadmu-ee9a9237d6324f1de1bb7150083eacf7b9af5f70.tar.gz
4802
Some automated commenting cleanup. Still needs more careful manual scanning.

  sed -i 's/^#   1-3/# . 1-3/' *.subx */*.subx
  sed -i 's/^#   op/# . op/' *.subx */*.subx
  sed -i 's/# vim/# . . vim/' *.subx */*.subx
  sed -i 's/^    # push args/    # . . push args/' *.subx */*.subx
  sed -i 's/^    # discard args/    # . . discard args/' *.subx */*.subx
  sed -i 's/^    # call/    # . . call/' *.subx */*.subx
  sed -i 's/^    # prolog/    # . prolog/' *.subx */*.subx
  sed -i 's/^    # epilog/    # . epilog/' *.subx */*.subx
  sed -i 's/^    # save registers/    # . save registers/' *.subx */*.subx
  sed -i 's/^    # restore registers/    # . restore registers/' *.subx */*.subx
  sed -i 's/  operand  /  register /' *.subx */*.subx
Diffstat (limited to 'subx/051test.subx')
-rw-r--r--subx/051test.subx34
1 files changed, 17 insertions, 17 deletions
diff --git a/subx/051test.subx b/subx/051test.subx
index e665793a..2f93c914 100644
--- a/subx/051test.subx
+++ b/subx/051test.subx
@@ -1,9 +1,9 @@
 # Rudimentary test harness
 
 == code
-#   instruction                     effective address                                                   operand     displacement    immediate
-#   op          subop               mod             rm32          base        index         scale       r32
-#   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
+#   instruction                     effective address                                                   register    displacement    immediate
+# . op          subop               mod             rm32          base        index         scale       r32
+# . 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes
 
 # main:  (manual test if this is the last file loaded)
     # check-ints-equal(34, 34)
@@ -19,10 +19,10 @@
 
 # print msg to stderr if a != b, otherwise print "."
 check-ints-equal:  # (a : int, b : int, msg : (address array byte)) -> boolean
-    # prolog
+    # . prolog
     55/push-EBP
     89/copy                         3/mod/direct    5/rm32/EBP    .           .             .           4/r32/ESP   .               .                 # copy ESP to EBP
-    # save registers
+    # . save registers
     51/push-ECX
     53/push-EBX
     # load first 2 args into EAX and EBX
@@ -32,41 +32,41 @@ check-ints-equal:  # (a : int, b : int, msg : (address array byte)) -> boolean
     39/compare                      3/mod/direct    0/rm32/EAX    .           .             .           3/r32/EBX   .               .                 # compare EAX and EBX
     75/jump-if-unequal  $check-ints-equal:else/disp8
     # _write(2/stderr, '.')
-      # push args
+    # . . push args
     68/push  "."/imm32
     68/push  2/imm32/stderr
-      # call
+    # . . call
     e8/call  _write/disp32
-      # discard args
+    # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
     # return
     eb/jump  $check-ints-equal:end/disp8
     # else:
 $check-ints-equal:else:
     # _write(2/stderr, msg)
-      # push args
+    # . . push args
     8b/copy                         1/mod/*+disp8   4/rm32/sib    5/base/EBP  4/index/none  .           1/r32/ECX   0x10/disp8      .                 # copy *(EBP+16) to ECX
     51/push-ECX
     68/push  2/imm32/stderr
-      # call
+    # . . call
     e8/call  _write/disp32
-      # discard args
+    # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
     # _write(2/stderr, Newline)
-      # push args
+    # . . push args
     68/push  Newline/imm32
     68/push  2/imm32/stderr
-      # call
+    # . . call
     e8/call  _write/disp32
-      # discard args
+    # . . discard args
     81          0/subop/add         3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # add to ESP
     # increment Num-test-failures
     ff          0/subop/increment   0/mod/indirect  5/rm32/.disp32            .             .           .           Num-test-failures/disp32          # increment *Num-test-failures
 $check-ints-equal:end:
-    # restore registers
+    # . restore registers
     5b/pop-to-EBX
     59/pop-to-ECX
-    # epilog
+    # . epilog
     89/copy                         3/mod/direct    4/rm32/ESP    .           .             .           5/r32/EBP   .               .                 # copy EBP to ESP
     5d/pop-to-EBP
     c3/return
@@ -82,4 +82,4 @@ Newline:
 Num-test-failures:
     00 00 00 00
 
-# vim:nowrap:textwidth=0
+# . . vim:nowrap:textwidth=0