Skip to navigation

Elite on the BBC Micro and NES

Version analysis of LYN

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

Code variations between these versions are shown below.

Name: LYN Type: Subroutine Category: Drawing the screen Summary: Clear most of a row of pixels




Code variation 1 of 2A variation in the comments only

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

Set pixels 0-233 to the value in A, starting at the pixel pointed to by SC. Arguments: A The value to store in pixels 1-233 (the only value that is actually used is A = 0, which clears those pixels) Returns: Y Y is set to 0 Other entry points: SC5 Contains an RTS
Zero memory from page X to page &75 (inclusive). Arguments: X The page of screen memory from which to start clearing
.LYN

Code variation 2 of 2Specific to an individual platform

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

LDY #233 \ Set up a counter in Y to count down from pixel 233 .EE2 STA (SC),Y \ Store A in the Y-th byte after the address pointed to \ by SC DEY \ Decrement Y BNE EE2 \ Loop back until Y is zero .SC5
JSR ZES1 \ Call ZES1 to zero-fill the page in X INX \ Increment X to point to the next page in memory CPX #&76 \ Loop back to zero the next page until we have reached BNE LYN \ page &76 (so page &75 is the last page to be zeroed)
 RTS                    \ Return from the subroutine