Skip to navigation


Version analysis of CLDELAY

This code appears in the following versions (click to see it in the source code):

Code variations between these versions are shown below.

Name: CLDELAY Type: Subroutine Category: Utility routines Summary: Delay by iterating through 5 * 256 (1280) empty loops

Code variation 1 of 2A variation in the comments only

This variation is blank in the 6502 Second Processor version.

This routine is unused in this version of Elite (it is left over from the 6502 Second Processor version).
.CLDELAY

Code variation 2 of 2Specific to an individual platform

Tap on a block to expand it, and tap it again to revert.

RTS \ Return from the subroutine, as CLDELAY does nothing in \ this version of Elite (it is left over from the 6502 \ Second Processor version)
PHX \ Store A, X and Y on the stack PHY PHA LDY #5 \ We are going to loop for 5 * 256 empty loops, so set a \ counter in Y for the outer loop LDX #0 \ And set a counter in X for the inner loop .CLDEL1 DEX \ Decrement the inner loop counter BNE CLDEL1 \ Loop back to CLDEL1 until the inner loop counter has \ rolled around to 0 again DEY \ Decrement the outer loop counter BNE CLDEL1 \ Loop back to CLDEL1 until the outer loop counter has \ reached 0 PLA \ Retrieve A, X and Y from the stack PLY PLX RTS \ Return from the subroutine