Skip to navigation

Elite on the BBC Micro

Utility routines: ZERO (Master version)

Name: ZERO [View in context] Type: Subroutine [Compare versions] Category: Utility routines Summary: Reset the local bubble of universe and ship status
This resets the following workspaces to zero: * UP workspace variables from FRIN to de, which include the ship slots for the local bubble of universe, and various flight and ship status variables
.ZERO LDX #(de-FRIN) \ We're going to zero the UP workspace variables from \ FRIN to de, so set a counter in X for the correct \ number of bytes LDA #0 \ Set A = 0 so we can zero the variables .ZEL2 STA FRIN,X \ Zero the X-th byte of FRIN to de DEX \ Decrement the loop counter BPL ZEL2 \ Loop back to zero the next variable until we have done \ them all RTS \ Return from the subroutine