Author Topic: Converting from ASCII to Integer  (Read 6961 times)

Offline Anonymous

  • Jr. Member
  • *
  • Posts: 78
  • Country: us
Re: Converting from ASCII to Integer
« Reply #15 on: June 17, 2014, 06:38:45 PM »
Thank you so much it works very good for untested code frank only one mistake but I fixed it for future reference if anyone looks at this page here it is:

Code: [Select]
.next:
; we do need to clear rdx here - "div" uses it
xor rdx, rdx

div rbx;divide by ten
; quotient in rax, remainder in rdx

add rdx, '0';convert to ASCII
; now we want to put it in our buffer...
mov byte [r8], dl

call print ; for every digit? okay...

                test rax, rax ; or cmp rax, 0
                jz .done

sub r8, 1
                jmp .next;instead of jmp top but I got what you ment :)
Thanks in advance, Anonymous