* File: delay.asm * Author: Tom Dickens * Date: 6/9/1997 * Processor Type: 68HC11E1 * * Purpose: To delay a bit. * ORG $B600 ; start of EEPROM Main: inc $1004 ; count on portB bsr Delay bra Main *======================================================================= * Subroutine: Delay * Inputs: -none- * Outputs:-none- * Purpose: To delay a total of 5.0005 mS. * For other times, vary the initial X value and use the * equation ((6 * X) + 17) * 500nS, where X can be a value * from 1 to 65536 (when X = 0). * Delay times range from 11.5 uS when X=1, to 196.6 mS * when X=0. For longer delays a double-loop must be used * (see delay_long.asm). *======================================================================= Delay: pshx ; 4 = 2.0 uS ldx #1664 ; 3 = 1.5 uS LoopX: dex ; 3 cycles = 1.5 uS bne LoopX ; 3 cycles = 1.5 uS pulx ; 5 = 2.5 uS rts ; 5 = 2.5 uS * end-of-file