Skip to navigation


Version analysis of ZEKTRAN

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

Code variations between these versions are shown below.

Name: ZEKTRAN Type: Subroutine Category: Keyboard

Code variation 1 of 6A variation in the comments only

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

Summary: Clear the key logger
Summary: Reset the key logger buffer at KTRAN

Code variation 2 of 6A variation in the comments only

This variation is blank in the 6502 Second Processor version.

Returns: X X is set to 0
.ZEKTRAN

Code variation 3 of 6Minor and very low-impact

This variation is blank in the Master version.

LDX #11 \ We use the first 12 bytes of the key logger buffer at \ KTRAN, so set a loop counter accordingly
 LDA #0                 \ We want to zero the key logger buffer, so set A % 0

Code variation 4 of 6Minor and very low-impact

This variation is blank in the 6502 Second Processor version.

LDX #17 \ We want to clear the 17 key logger locations from \ KL to KY20, so set a counter in X
.ZEKLOOP

Code variation 5 of 6Minor and very low-impact

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

STA JSTY,X \ Store 0 in the X-th byte of the key logger DEX \ Decrement the counter BNE ZEKLOOP \ And loop back for the next key, until we have just \ KL+1. We don't want to clear the first key logger \ location at KL, as the keyboard table at KYTB starts \ with offset 1, not 0, so KL is not technically part of \ the key logger (it's actually used for logging keys \ that don't appear in the keyboard table, and which \ therefore don't use the key logger)
STA KTRAN,X \ Reset the X-th byte of the key logger buffer to 0 DEX \ Decrement the loop counter BPL ZEKLOOP \ Loop back until we have zeroed bytes #11 through #0
 RTS                    \ Return from the subroutine

Code variation 6 of 6Minor and very low-impact

This variation is blank in the Master version.

RTS \ This instruction has no effect as we already returned \ from the subroutine