I've written a solo program just to figure out how to do this, earlier I added 48 to the number to print but now when I get numbers larger than 9 it's not really sufficient any more.
So the following program should put 23 into the my temp, compares 23 to 10 if it's smaller than 10 I can print otherwise put the temp away in rax, put 10 in r11 and divide 23 by 10. Put the result from rax in temp and check again. I still need to add a way to retrieve the earlier numbers but first thing first. Have I missunderstood what happens, the result I get is float number error
#include <stdio.h> #Inkludera standard I/O
.data #Specifiera data
temp: .quad 0
temp2: .quad 0
.text
.global main
main:
movq $23, temp
jmp check
check:
cmpq $10, $temp
jl under10
movq $temp, %rax
movq $10, %r11
divq %r11
movq %rax,temp
jmp check
under10:
addq $48, temp
movq $temp,%rdi
call puts