Hello everyone, I have a really weird problem to submit. I have this binary to bcd conversion routine that works for most values. It takes the two byte binary value storred in "BUFFER" and converts it to its four byte BCD equivalent. When I submit values that end with $FC ($01FC, $02FC, etc.), the routine fails, although it works properly when walked through by hand and using simulator software. I have included the routine here for reference. Any help would be apreciated. Thanks in advance. ;******* ; BINBCD ; ; This routine implements the binary to BCD conversion (not ASCII). ; A pointer to an array containing the binary data (up to 2 bytes) is ; passed in buffer. The data is passed on least significant byte ; first, and the buffer must be 5 bytes long. The result is placed in ; the input buffer, least significant digit first. ; ; Variables needed by the routine: ; ; buffer rmb 6 ; bin_word rmb 2 ; ; ******* ?binbcd lda buffer sta bin_word lda buffer+1 sta bin_word+1 lda #$00 sta buffer+1 sta buffer+2 sta buffer+3 sta buffer+4 lda bin_word sub #$10 sta temp lda bin_word+1 sbc #$27 sta temp+1 ?bincd_dig4 lda temp+1 blo ?bincd_dig3_in sta bin_word+1 lda temp sta bin_word inc buffer+4 sub #$10 sta temp lda temp+1 sbc #$27 sta temp+1 bra ?bincd_dig4 ?bincd_dig3_in lda bin_word sub #$e8 sta temp lda bin_word+1 sbc #$03 sta temp+1 ?bincd_dig3 lda temp+1 blo ?bincd_dig2_in sta bin_word+1 lda temp sta bin_word inc buffer+3 sub #$e8 sta temp lda temp+1 sbc #$03 sta temp+1 bra ?bincd_dig3 ?bincd_dig2_in lda bin_word sub #$64 sta temp lda bin_word+1 sbc #$00 sta temp+1 ?bincd_dig2 lda temp+1 blo ?bincd_dig1_in sta bin_word+1 lda temp sta bin_word inc buffer+2 sub #$64 sta temp lda temp+1 sbc #$00 sta temp+1 bra ?bincd_dig2 ?bincd_dig1_in lda bin_word sub #$0a sta temp ?bincd_dig1 lda temp blo ?bincd_dig0_in sta bin_word inc buffer+1 sub #$0a sta temp bra ?bincd_dig1 ?bincd_dig0_in lda bin_word sta buffer rts