Check out and contribute to CodePedia, the wiki for developers.

View \TIER0.ASM

BANEL GSM

Submitted By: jaroban
Rating: starstarstarstar (Rate It)


; version 1.0

asc_hex:        clr     c
                subb    a,#'0'
                jc      asc_hex_no
                subb    a,#'9'-'0'+1
                jc      asc_hex_10
                subb    a,#'A'-'9'-1
                jc      asc_hex_no
                subb    a,#'F'-'A'+1
                jc      asc_hex_16
                subb    a,#'a'-'F'-1
                jc      asc_hex_no
                subb    a,#'f'-'a'+1
                jnc     asc_hex_ret
asc_hex_16:     add     a,#16
                setb    c
                ret
asc_hex_10:     add     a,#10
                setb    c
asc_hex_ret:    ret
asc_hex_no:     clr     c
                ret

hex_asc:        anl     a,#0fh
                jnb     acc.3,hex_asc_noadj
                jb      acc.2,hex_asc_adj
                jnb     acc.1,hex_asc_noadj
hex_asc_adj:    add     a,#'a'-'0'-10
hex_asc_noadj:  add     a,#'0'
                ret

copy_from_code: clr     a
                movc    a,@a+dptr
                inc     dptr
                mov     @r0,a
                inc     r0
                djnz    r1,copy_from_code
                ret

corner
© 1996-2008. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin.
bootstrapLabs Logo A bootstrapLabs project.