Skip to navigation


Utility routines: SWAPPZERO

[Commodore 64 version]

Name: 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 reversed
Context: 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
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 ENDIF