about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-08-20 23:13:53 -0700
committerKartik Agaram <vc@akkartik.com>2018-08-20 23:17:52 -0700
commitb5737fc0efcd929dc6a66afd0b9537b44ce1290a (patch)
tree49e4a3abcd3f112b50416ddf7ac439c236e90db6 /subx
parent10ad628f73a02697763ad82a69a91ffacf5edb47 (diff)
downloadmu-b5737fc0efcd929dc6a66afd0b9537b44ce1290a.tar.gz
4524
Diffstat (limited to 'subx')
-rw-r--r--subx/ex2.subx2
-rw-r--r--subx/ex3.subx6
-rw-r--r--subx/ex6.subx2
-rw-r--r--subx/ex8.subx2
4 files changed, 6 insertions, 6 deletions
diff --git a/subx/ex2.subx b/subx/ex2.subx
index c63b7eb6..6463132b 100644
--- a/subx/ex2.subx
+++ b/subx/ex2.subx
@@ -12,7 +12,7 @@
 # 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
   bb/copy                                                                                                                         1/imm32           # copy 1 to EBX
-  81          0/subop/add         3/mod/direct    3/rm32/ebx                                                                      1/imm32           # add 1 to EBX
+  81          0/subop/add         3/mod/direct    3/rm32/EBX                                                                      1/imm32           # add 1 to EBX
   # exit(EBX)
   b8/copy                                                                                                                         1/imm32           # copy 1 to EAX
   cd/syscall                                                                                                                      0x80/imm8         # int 80h
diff --git a/subx/ex3.subx b/subx/ex3.subx
index 41d2b94e..a4012f92 100644
--- a/subx/ex3.subx
+++ b/subx/ex3.subx
@@ -18,12 +18,12 @@
 
 $loop:
   # while (counter <= 10)
-  81          7/subop/compare     3/mod/direct    1/rm32/ecx                                                                      0xa/imm32         # compare ECX, 10/imm
+  81          7/subop/compare     3/mod/direct    1/rm32/ECX                                                                      0xa/imm32         # compare ECX, 10/imm
   7f/jump-if                                                                                                      $exit/disp8                       # jump-if-greater $exit
   # result += counter
-  01/add                          3/mod/direct    3/rm32/ebx                                          1/r32/ecx                                     # add ECX to EBX
+  01/add                          3/mod/direct    3/rm32/EBX                                          1/r32/ECX                                     # add ECX to EBX
   # ++counter
-  81          0/subop/add         3/mod/direct    1/rm32/ecx                                                                      1/imm32           # add 1 to ECX
+  81          0/subop/add         3/mod/direct    1/rm32/ECX                                                                      1/imm32           # add 1 to ECX
   # loop
   eb/jump                                                                                                         $loop/disp8                       # jump $loop
 
diff --git a/subx/ex6.subx b/subx/ex6.subx
index 5d21f525..4c75c617 100644
--- a/subx/ex6.subx
+++ b/subx/ex6.subx
@@ -17,7 +17,7 @@
   b9/copy                                                                                                                         0x08049097/imm32  # copy to ECX
   # initialize size
   ba/copy                                                                                                                         0x08049093/imm32  # copy to EDX
-  8b/copy                         0/mod/indirect  2/rm32/edx                                          2/r32/edx                                     # copy *EDX to EDX
+  8b/copy                         0/mod/indirect  2/rm32/EDX                                          2/r32/EDX                                     # copy *EDX to EDX
   # write(fd, x, size)
   b8/copy                                                                                                                         4/imm32           # copy 4 to EAX
   cd/syscall                                                                                                                      0x80/imm8         # int 80h
diff --git a/subx/ex8.subx b/subx/ex8.subx
index 0512157f..6f8d3979 100644
--- a/subx/ex8.subx
+++ b/subx/ex8.subx
@@ -84,7 +84,7 @@
 
   ## exit(b)
   # load b
-  bb                              .               .             .           .             .           .           .               0x0804912d/imm32/b      # copy to EBX
+  bb/copy                         .               .             .           .             .           .           .               0x0804912d/imm32/b      # copy to EBX
   8b/copy                         0/mod/indirect  3/rm32/EBX                                          3/r32/EBX                                           # copy *EBX to EBX
   #
   b8/copy                         .               .             .           .             .           .           .               1/imm32/exit            # copy 1 to EAX