Created
August 26, 2022 17:33
-
-
Save AliLtRP/a4701201317aca601bf8debf46e43b82 to your computer and use it in GitHub Desktop.
Count Odd Numbers Below N in x86_64 Nasm
This file contains 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 .text | |
global oddcnt | |
; <-- EAX oddcnt(EDI n) --> | |
oddcnt: | |
xor eax, eax | |
mov edx, 0 | |
mov eax, edi | |
mov ebx, 2 | |
div ebx | |
ret | |
; -----> endof oddcnt <----- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment