From 333525360b22f3d3ea31db46a4d2f1b4edbfebdb Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 26 Aug 2019 11:55:26 -0700 Subject: 5592 - switch register names to lowercase --- html/076zero-out.subx.html | 72 +++++++++++++++++++++++----------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'html/076zero-out.subx.html') diff --git a/html/076zero-out.subx.html b/html/076zero-out.subx.html index 2bb15365..2ba33c80 100644 --- a/html/076zero-out.subx.html +++ b/html/076zero-out.subx.html @@ -66,8 +66,8 @@ if ('onhashchange' in window) { 7 8 zero-out: # start : address, len : int 9 # pseudocode: -10 # curr/ESI = start -11 # i/ECX = 0 +10 # curr/esi = start +11 # i/ecx = 0 12 # while true 13 # if (i >= len) break 14 # *curr = 0 @@ -75,69 +75,69 @@ if ('onhashchange' in window) { 16 # ++i 17 # 18 # . prolog -19 55/push-EBP -20 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP +19 55/push-ebp +20 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp 21 # . save registers -22 50/push-EAX -23 51/push-ECX -24 52/push-EDX -25 56/push-ESI -26 # curr/ESI = start -27 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 6/r32/ESI 8/disp8 . # copy *(EBP+8) to ESI -28 # i/ECX = 0 -29 31/xor 3/mod/direct 1/rm32/ECX . . . 1/r32/ECX . . # clear ECX -30 # EDX = len -31 8b/copy 1/mod/*+disp8 5/rm32/EBP . . . 2/r32/EDX 0xc/disp8 . # copy *(EBP+12) to EDX +22 50/push-eax +23 51/push-ecx +24 52/push-edx +25 56/push-esi +26 # curr/esi = start +27 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi +28 # i/ecx = 0 +29 31/xor 3/mod/direct 1/rm32/ecx . . . 1/r32/ecx . . # clear ecx +30 # edx = len +31 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 2/r32/edx 0xc/disp8 . # copy *(ebp+12) to edx 32 $zero-out:loop: 33 # if (i >= len) break -34 39/compare 3/mod/direct 1/rm32/ECX . . . 2/r32/EDX . . # compare ECX with EDX +34 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . . # compare ecx with edx 35 7d/jump-if-greater-or-equal $zero-out:end/disp8 36 # *curr = 0 -37 c6 0/subop/copy 0/mod/direct 6/rm32/ESI . . . . . 0/imm8 # copy byte to *ESI +37 c6 0/subop/copy 0/mod/direct 6/rm32/esi . . . . . 0/imm8 # copy byte to *esi 38 # ++curr -39 46/increment-ESI +39 46/increment-esi 40 # ++i -41 41/increment-ECX +41 41/increment-ecx 42 eb/jump $zero-out:loop/disp8 43 $zero-out:end: 44 # . restore registers -45 5e/pop-to-ESI -46 5a/pop-to-EDX -47 59/pop-to-ECX -48 58/pop-to-EAX +45 5e/pop-to-esi +46 5a/pop-to-edx +47 59/pop-to-ecx +48 58/pop-to-eax 49 # . epilog -50 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP -51 5d/pop-to-EBP +50 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp +51 5d/pop-to-ebp 52 c3/return 53 54 test-zero-out: 55 # . prolog -56 55/push-EBP -57 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP -58 # region/ECX = 34, 35, 36, 37 +56 55/push-ebp +57 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp +58 # region/ecx = 34, 35, 36, 37 59 68/push 0x37363534/imm32 -60 89/copy 3/mod/direct 1/rm32/ECX . . . 4/r32/ESP . . # copy ESP to ECX -61 # zero-out(ECX, 3) +60 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx +61 # zero-out(ecx, 3) 62 # . . push args 63 68/push 3/imm32/len -64 51/push-ECX +64 51/push-ecx 65 # . . call 66 e8/call zero-out/disp32 67 # . . discard args -68 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +68 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 69 # first 3 bytes cleared, fourth left alone -70 # . check-ints-equal(*ECX, 0x37000000, msg) +70 # . check-ints-equal(*ecx, 0x37000000, msg) 71 # . . push args 72 68/push "F - test-zero-out"/imm32 73 68/push 0x37000000/imm32 -74 ff 6/subop/push 0/mod/indirect 1/rm32/ECX . . . . . . # push *ECX +74 ff 6/subop/push 0/mod/indirect 1/rm32/ecx . . . . . . # push *ecx 75 # . . call 76 e8/call check-ints-equal/disp32 77 # . . discard args -78 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP +78 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 79 # . epilog -80 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP -81 5d/pop-to-EBP +80 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp +81 5d/pop-to-ebp 82 c3/return 83 84 # . . vim:nowrap:textwidth=0 -- cgit 1.4.1-2-gfad0