format ELF64 extrn printf extrn puts extrn scanf public main section '.text' executable main: push rbp mov rbp,rsp mov edi,prompt call puts sub rsp,16 mov rsi,rsp mov edi,readint xor eax,eax call scanf mov rax,[rsp] add rsp,16 mov rdx,rax and rdx,1 add rax,rdx mov rsi,rax mov edi,msg xor eax,eax call printf leave ret section '.data' writable align 16 msg db "Next even integer is %ld",0xA,0 prompt db "Enter an odd integer.",0 readint db "%ld",0