From e42b567df7990dd6119d10eb9aa1375ee5a57cd9 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Fri, 15 Sep 2023 11:55:12 +0000 Subject: [PATCH] some comment for 0x00 --- 0x00.asm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/0x00.asm b/0x00.asm index 403a8e4..6754200 100644 --- a/0x00.asm +++ b/0x00.asm @@ -2,15 +2,17 @@ SECTION .text global main +; all the different ways to set registers to 0. + main: - xor eax, eax - lea rbx, [0] + xor eax, eax ; xor with itself + lea rbx, [0] ; load effective address into rbx ; ecx usually starts with a high value, loop decrements this ; so this makes it all a bit faster mov ecx, 10 - loop $ - mov rdx, 0 - and esi, 0 - sub edi, edi - push 0 - pop rbp + loop $ ; loop until ecx hits 0. `$` is this instruction. + mov rdx, 0 ; move 0 into rdx + and esi, 0 ; bitwise-and esi with 0 + sub edi, edi ; substract from itself + push 0 ; put 0 on the stack + pop rbp ; pop stack into rbp