/[avr-libc]/avr-libc/libc/misc/utoa.S
ViewVC logotype

Diff of /avr-libc/libc/misc/utoa.S

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by aesok, Wed Oct 12 20:41:59 2005 UTC revision 1.7 by aesok, Wed Oct 19 20:12:45 2005 UTC
# Line 63  Line 63 
63    
64    
65  _U(utoa):  _U(utoa):
66          mov     ZL, r_str_lo    ; &string          X_movw  ZL, r_str_lo    ; &string
67          mov     ZH, r_str_hi          X_movw  r_lstr_lo, ZL   ; save &string
         mov     r_lstr_lo, ZL   ; save &string  
         mov     r_lstr_hi, ZH  
68          cpi     r_radix, 2      ; no radix < 2          cpi     r_radix, 2      ; no radix < 2
69          brlt    99f          brlt    99f
70          cpi     r_radix, 37     ; no radix > 36          cpi     r_radix, 37     ; no radix > 36
# Line 83  _U(utoa): Line 81  _U(utoa):
81          subi    r24, 0xd9       ; + 'a' - 10 - '0'          subi    r24, 0xd9       ; + 'a' - 10 - '0'
82  10:  10:
83          st      Z+, r24         ; write char to string in reverse order!          st      Z+, r24         ; write char to string in reverse order!
84          mov     r_val_lo,r22    ; quotient -> dividend          X_movw  r_val_lo,r22    ; quotient -> dividend
         mov     r_val_hi,r23  
85          sbiw    r_val_lo,0      ; value == 0 ?          sbiw    r_val_lo,0      ; value == 0 ?
86          brne    1b          brne    1b
87  99:  99:
         mov     r_val_hi, r_lstr_hi     ; restore &string as return value  
         mov     r_val_lo, r_lstr_lo  
88          st      Z, __zero_reg__ ; terminate string          st      Z, __zero_reg__ ; terminate string
89            X_movw  r_val_lo, r_lstr_lo     ; restore &string as return value
90          XJMP    _U(strrev)      ; reverse string          XJMP    _U(strrev)      ; reverse string
91    
92          .endfunc          .endfunc

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26