Skip to navigation

Elite on the BBC Micro

Utility routines: MVPG (Disc version)

Name: MVPG [View in context] Type: Subroutine Category: Utility routines Summary: Decrypt and move a page of memory
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 decrypted 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