* File: delay_long.asm * Author: Tom Dickens * Date: 6/9/1997 * Processor Type: 68HC11E1 * * Purpose: To delay a bit longer. * ORG $B600 ; start of EEPROM Main: inc $1004 ; count on portB bsr DelayLong bra Main *======================================================================= * Subroutine: DelayLong * Inputs: -none- * Outputs:-none- * Purpose: To delay a total of 1.000114 S. * For other times, vary the initial X and Y values and use * the equation (((6 * X) + 10) * Y + 29) * 500nS, where X and * Y can be values from 1 to 65536 (at zero). * Delay times range from of 22.5 uS when X=1 and Y=1, to * 12.885 S when X=0,Y=0. *======================================================================= DelayLong: pshx ; 4 = 2.0 uS pshy ; 5 = 2.5 uS ldy #100 ; 4 = 2.0 uS LoopY: ldx #3332 ; 3 = 1.5 uS LoopX: dex ; 3 cycles = 1.5 uS bne LoopX ; 3 cycles = 1.5 uS dey ; 4 cycles = 2.0 uS bne LoopY ; 3 cycles = 1.5 uS puly ; 6 = 3.0 uS pulx ; 5 = 2.5 uS rts ; 5 = 2.5 uS * end-of-file