IF _GMA_RELEASE .SWAPPZERO LDX #K3+1 ; This routine starts copying zero page from $0015 and ; up, using X as an index .SWPZL LDA ZP,X ; Swap the X-th byte of zero page with the X-th byte of LDY $CE00,X ; $CE00 STA $CE00,X STY ZP,X INX ; Increment the loop counter BNE SWPZL ; Loop back for the next byte RTS ; Return from the subroutine ENDIFName: SWAPPZERO [Show more] Type: Subroutine Category: Utility routines Summary: A routine that swaps zero page with the page at $CE00, so that zero page changes made by Kernal functions can be reversedContext: See this subroutine in context in the source code References: This subroutine is called as follows: * KERNALSETUP calls SWAPPZERO * LOD calls SWAPPZERO * SVE calls SWAPPZERO
[X]
Label SWPZL is local to this routine
[X]
Workspace ZP (category: Workspaces)
Lots of important variables are stored in the zero page workspace as it is quicker and more space-efficient to access memory here