Skip to navigation

Revs on the BBC Micro

Setup: Entry

Name: Entry [Show more] Type: Subroutine Category: Setup Summary: The main entry point for the game: move code into upper memory and call it Deep dive: The jigsaw puzzle binary
Context: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
ORG &1200 .Entry LDY #0 \ We start by copying the following block in memory: \ \ * &1200-&12FF is copied to &7900-&79FF \ \ so set up a byte counter in Y .entr1 LDA &1200,Y \ Copy the Y-th byte of &1200 to the Y-th byte of &7900 STA &7900,Y INY \ Increment the byte counter BNE entr1 \ Loop back until we have copied a whole page of bytes JMP SwapCode \ Jump to the routine that we just moved to continue the \ setup process \ This code starts out at &1200 and is run there, before it moves itself to \ &7900-&790D along with the rest of the page, so the following moves this code \ next to the block that runs at &790E-&79FF COPYBLOCK &1200, &120E, &7900 CLEAR &1200, &120E