Skip to content

Instantly share code, notes, and snippets.

@AliLtRP
Created August 26, 2022 17:33
Show Gist options
  • Save AliLtRP/a4701201317aca601bf8debf46e43b82 to your computer and use it in GitHub Desktop.
Save AliLtRP/a4701201317aca601bf8debf46e43b82 to your computer and use it in GitHub Desktop.
Count Odd Numbers Below N in x86_64 Nasm
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