Working on an assembly project, I'm trying to use "puts" to print an integer saved in a temporary variable. I'm aware that the integer has to be reformatted to a string format before it can be printed and my question is how to do that. Using AT&T syntax. for example:
.data
temp: .quad 0
outbuf: .space 64
.global main
main:
movq $5, temp
reformat:
// the function to reformat the temp variable and move it to outbuf
printBuf:
movq outbuf, %rdi
call puts
ret