some comment for 0x00
This commit is contained in:
parent
8a4bc9cf6c
commit
e42b567df7
18
0x00.asm
18
0x00.asm
|
@ -2,15 +2,17 @@
|
||||||
SECTION .text
|
SECTION .text
|
||||||
global main
|
global main
|
||||||
|
|
||||||
|
; all the different ways to set registers to 0.
|
||||||
|
|
||||||
main:
|
main:
|
||||||
xor eax, eax
|
xor eax, eax ; xor with itself
|
||||||
lea rbx, [0]
|
lea rbx, [0] ; load effective address into rbx
|
||||||
; ecx usually starts with a high value, loop decrements this
|
; ecx usually starts with a high value, loop decrements this
|
||||||
; so this makes it all a bit faster
|
; so this makes it all a bit faster
|
||||||
mov ecx, 10
|
mov ecx, 10
|
||||||
loop $
|
loop $ ; loop until ecx hits 0. `$` is this instruction.
|
||||||
mov rdx, 0
|
mov rdx, 0 ; move 0 into rdx
|
||||||
and esi, 0
|
and esi, 0 ; bitwise-and esi with 0
|
||||||
sub edi, edi
|
sub edi, edi ; substract from itself
|
||||||
push 0
|
push 0 ; put 0 on the stack
|
||||||
pop rbp
|
pop rbp ; pop stack into rbp
|
||||||
|
|
Loading…
Reference in a new issue