Skip to navigation

Elite on the BBC Micro

Version analysis of DENGY

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

Code variations between these versions are shown below.

Name: DENGY Type: Subroutine Category: Flight Summary: Drain some energy from the energy banks
Returns: Z flag Set if we have no energy left, clear otherwise
.DENGY DEC ENERGY \ Decrement the energy banks in ENERGY PHP \ Save the flags on the stack

Code variation 1 of 1Specific to an individual platform

Tap on a version to expand it, and tap it again to show to all variations.

Cassette, Flight, Docked, 6502SP, Electron

Master

BNE P%+5 \ If the energy levels are not yet zero, skip the \ following instruction
BNE P%+4 \ If the energy levels are not yet zero, skip the \ following instruction
 INC ENERGY             \ The minimum allowed energy level is 1, and we just
                        \ reached 0, so increment ENERGY back to 1

 PLP                    \ Restore the flags from the stack, so we return with
                        \ the Z flag from the DEC instruction above

 RTS                    \ Return from the subroutine

RSS Feed