> Hi Andy. > > Squeezing the lemon :) > > incf reg,F ;INCF REG > movlw 0x66 ;MOVLW 0x06 > addwf reg,F ;ADDWF REG > skpndc ;SKPDC > andlw 0xF0 ;SUBWF REG > skpnc ;MOVLW 0x60 > andlw 0x0F ;ADDWF REG > subwf reg,F ;SKPC > ;SUBWF REG ;;btw here Cy is always=1 When this routine finishes, W contains 0x00, 0x06, 0x60, or 0x66. The upper nibble is 0 when the carry should be set. So, if you follow this with: sublw 0x5F ; or any number between 0x06 and 0x5F The carry bit is restored and you can cascade the result: skpnc incf reg2,F followed by the binary to bcd conversion. (or you can write skpc/return). Scott -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist