Can anyone tell me the purely assembly code for displaying the value in a register in decimal format? Please don\'t suggest using the printf hack and then compile w
Can't comment so I post reply this way. @Ira Baxter, perfect answer I just want to add that you don't need to divide 10 times as you posted that you set register cx to value 10. Just divide number in ax until "ax==0"
loop1: call dividebyten
...
cmp ax,0
jnz loop1
You also have to store how many digits was there in original number.
mov cx,0
loop1: call dividebyten
inc cx
Anyway you Ira Baxter helped me there is just few ways how to optimize code :)
This is not only about optimization but also formatting. When you want to print number 54 you want print 54 not 0000000054 :)