Sorry Steve, you forgot to include the "incf delay,f" at Delay_routine_1 in your count. And, as Harold noted, we need a clrc before the rlf So, at this point the best we have is 13 instructions. For amusement, here is another way to set up the argument to the delay routine, this time with the assumption that it expects its argument in W, and returns W == 0: rlf bits,f skpnz ret ; next instruction is very sneaky. it depends on the ; fact that CARRY is the LSBIT of STATUS rlf STATUS,W andlw 2 ; W is now 0 or 2 Unfortunately this doesn't save us any instructions Bob Ammerman ========================== Steve Smith's version: movwf bits loop: rlf bits,f skpnz ret ; cy is 0 for a DIT, 1 for a DAH, so... Skpnc ; carry is valid from the rotate Bsf delay_count,1 ; delay is 2 or 0 bsf portb,1 ; turn on tone generator call delay_routine_1 bcf portb,1 ; turn off tone generator call delay_routine_1 bra loop Delay_routine_1 Incf delay,f <--this is instruction 12 Delay.... -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist