AppleIIAsm-Collection/disks/disk2_common/T.DELAYMS.SUB.MIN
nathanriggs 12a0b19398 Disk 2 COMMON library 0.3.0 updates
- added some error control
- added initial jump table
- fixed a few minor bugs
- separated common library into separate subroutine files
2019-01-14 10:57:05 -05:00

30 lines
849 B
Plaintext

DELAYMS
MSCNT EQU $0CA ; 202 TIMES THROUGH DELAY1
; SPECIFIC TO 1.23 MHZ
; SPEED OF APPLE II
:DELAY
CPY #0 ; 2 CYCLES
BEQ :EXIT ; 2C (EXIT IF DEL=0)
NOP ; 2 CYCLES (MAKE OVERHEAD=25C)
CPY #1 ; 2 CYCLES
BNE :DELAYA ; 3C IF TAKEN, ELSE 2C
JMP :LAST1 ; 3C
:DELAYA
DEY ; 2C (PREDEC Y)
:DELAY0
LDX #MSCNT ; 2C
:DELAY1
DEX ; 2C
BNE :DELAY1 ; 3C
NOP ; 2C
NOP ; 2C
DEY ; 2C
BNE :DELAY0 ; 3C
:LAST1
LDX #MSCNT-3 ; 2C
:DELAY2
DEX ; 2C
BNE :DELAY2 ; 3C
:EXIT
RTS ; 6C