diff options
Diffstat (limited to 'subx/ex3.subx')
-rw-r--r-- | subx/ex3.subx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/subx/ex3.subx b/subx/ex3.subx index 5b3fdb16..b2d6d7c4 100644 --- a/subx/ex3.subx +++ b/subx/ex3.subx @@ -12,24 +12,24 @@ # 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 # result: EBX = 0 - bb 0/imm32 # copy 0 to EBX + bb/copy 0/imm32 # copy 0 to EBX # counter: ECX = 1 - b9 1/imm32 # copy 1 to ECX + b9/copy 1/imm32 # copy 1 to ECX loop: # while (ECX <= 10) 81 7/subop/compare 3/mod/direct 1/rm32/ecx 0xa/imm32 # compare ECX, 10/imm - 7f exit/disp8 # jump-if-greater + 7f/jump-if exit/disp8 # jump-if-greater exit # EBX += ECX - 01 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 # ECX++ 81 0/subop/add 3/mod/direct 1/rm32/ecx 1/imm32 # add 1 to ECX # loop - eb loop/disp8 # jump + eb/jump loop/disp8 # jump loop exit: # exit(EBX) - b8 1/imm32 # copy 1 to EAX - cd 0x80/imm8 # int 80h + b8/copy 1/imm32 # copy 1 to EAX + cd/syscall 0x80/imm8 # int 80h # vim:ft=subx:nowrap |