User Tools

Site Tools


base:8_bit_to_hexadecimal_conversion

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
base:8_bit_to_hexadecimal_conversion [2017-08-20 00:17] tww_ctrbase:8_bit_to_hexadecimal_conversion [2017-08-20 00:30] (current) tww_ctr
Line 77: Line 77:
 HEX adc #$36 ; Accu >= 10, subtract #$09 to get "A" to "F" (CARRY always set here) HEX adc #$36 ; Accu >= 10, subtract #$09 to get "A" to "F" (CARRY always set here)
  jmp BSOUT ; Print Accu (HEX nibble) and bye  jmp BSOUT ; Print Accu (HEX nibble) and bye
 +</code>
 +
 +Version not using KERNAL:
 +
 +<code>
 +    // Dest.          = YREG:XREG
 +    // Value to utput = ACC
 +OUTHEX:
 +    sty $fb
 +    stx $fc
 +    ldy #$00
 +    pha
 +    lsr
 +    lsr
 +    lsr
 +    lsr
 +    tax
 +    lda tab,x
 +    sta ($fb),y
 +    iny
 +    pla
 +    and #$0f
 +    tax
 +    lda tab,x
 +    sta ($fb),y
 +    rts
 +
 +tab:
 +    .text "0123456789abcdef"
 </code> </code>
  
base/8_bit_to_hexadecimal_conversion.1503181059.txt.gz · Last modified: 2017-08-20 00:17 by tww_ctr