Created
February 6, 2024 09:06
-
-
Save 0x61nas/4317d45a1e0ade153a24ce69f7dd9283 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
section .data | |
section .text | |
global .start | |
start: | |
; When you want to put the value 0 into a register, the fastest way is to use XOR. | |
; XORing a value againsnt it self yields 0. | |
xor rbx, rbx | |
; Yes, you could use `mov rbx, 0` instnad, but that has to go out to memory to load the immediate value 0 | |
; XORing register against it self doesn't go out of the CPU for either the source or the destination, so its a little bit faster. | |
xor rcx, rcx | |
mov rax, 067feh | |
mov rbx, rax | |
mov cl, bh | |
mov ch, bl | |
xchg cl, ch | |
section .bass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment