Skip to navigation

Elite on the BBC Micro and NES

Version analysis of TR1

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

Code variations between these versions are shown below.

Name: TR1 Type: Subroutine Category: Save and load Summary: Copy the last saved commander's name from NA% to INWK
.TR1 LDX #7 \ The commander's name can contain a maximum of 7 \ characters, and is terminated by a carriage return, \ so set up a counter in X to copy 8 characters .GTL2

Code variation 1 of 1Specific to an individual platform

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

LDA NA%,X \ Copy the X-th byte of NA% to the X-th byte of INWK STA INWK,X
LDA NA%,X \ Copy the X-th byte of NA% to the X-th byte of INWK+5 STA INWK+5,X
 DEX                    \ Decrement the loop counter

 BPL GTL2               \ Loop back until we have copied all 8 bytes

 RTS                    \ Return from the subroutine