I'm trying to print '12345' using printf in assembly with nasm. It keeps printing age. I'm basing this off of a lab we did where we printed a counter digit (just a single digit) and it worked.
Must I use the divide by 10 method or is this close to how it should be setup to print '12345'
bits 64
global main
extern printf
section .text
main:
;function setup
push rbp
mov rbp, rsp
sub rsp, 32
;
lea rdi, [rel message]
mov al, 0
call printf
;mov rdi,format
;push count
;push format
mov rax, 12345
push rax
push format
;mov al,0
call printf
;add esp,8
;ret
; function return
mov eax, 0
add rsp, 32
pop rbp
ret
section .data
message: db 'Lab 3 - Modified hello program',0x0D,0x0a,'COSC2425 - Pentium assembly language',0x0D,0x0a,'Processed with NASM and GNU gcc',0x0D,0x0a
count dq 12345
format db '%d',10,0