Skip to navigation

Elite on the BBC Micro and NES

Utility routines: MVPG

[BBC Micro disc version, Loader 3]

Name: MVPG [Show more] Type: Subroutine Category: Utility routines Summary: Decrypt and move a page of memory
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * Elite loader (Part 1 of 3) calls MVPG * MVBL calls MVPG * PLL1 (Part 3 of 3) calls MVPG

Arguments: P(1 0) The source address of the page to move ZP(1 0) The destination address of the page to move
.MVPG LDY #0 \ We want to move one page of memory, so set Y as a byte \ counter .MPL LDA (P),Y \ Fetch the Y-th byte of the P(1 0) memory block EOR #&A5 \ Decrypt it by EOR'ing with &A5 STA (ZP),Y \ Store the result in the Y-th byte of the ZP(1 0) \ memory block DEY \ Decrement the byte counter BNE MPL \ Loop back to copy the next byte until we have done a \ whole page of 256 bytes RTS \ Return from the subroutine EQUB &0E \ This byte appears to be unused