From b5737fc0efcd929dc6a66afd0b9537b44ce1290a Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 20 Aug 2018 23:13:53 -0700 Subject: 4524 --- subx/ex2.subx | 2 +- subx/ex3.subx | 6 +++--- subx/ex6.subx | 2 +- subx/ex8.subx | 2 +- 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 -- cgit 1.4.1-2-gfad0