Oouch! I've just realized that the times of day from 5 to 10 AM and PM do actually exist, so I guess my BCD clock code should have a few changes. Luckily for me, the changes that were needed were just eliminating two lines, so the result was shorter: > ; BCD clock code challenge > ; WARNING: This code is not tested > ; > ; The regs must be allocated so that a certain bit is set only for > ; the hours, for example: > > seconds EQU $20 ; mm, it would work the same with 20 decimal > minutes EQU $21 ; but, to be honest, my intention was to put > hours EQU $22 ; it in hex > #define hoursFlag FSR,1 > > ClockTick: MOVLW seconds > loop: MOVWF FSR > INCF INDF,f > MOVLW 6 ; I removed two lines that were here > ADDWF INDF,f > BTFSS STATUS,DC > SUBWF INDF,f > MOVLW 60 > BTFSC hoursFlag > MOVLW 24 > SUBWF INDF,W > BTFSS STATUS,C > RETURN > CLRF INDF > INCF FSR,W > BTFSS hoursFlag > GOTO loop > ; This last instruction is not necessary if the code that's executed > ; after the routine follows, in that case the "RETURN" of a fwe lines > ; above should be a "GOTO..." > RETURN > IF it works, it is 17 or 18 ROM words long, and uses 3 regs and FSR. That is 29 or 30 points. Mmm, I guess it is a draw with Scott-and-Andrew's routine. . . The nice thing about this one is that it uses no stack space. Regards, Andres Djordjalian mailto:adjordj@aleph.fi.uba.ar *** INDICART Carteles Electronicos Buenos Aires, Argentina *** http://www.indicart.com.ar