JSR swap - software to interchange pages 0 and 1 in a 6502-based system
JSR SWAP elektor january 1985 Whenever two (or more) large programs must exist at the same time in a 6502"s memory there is bound to be a conflict as regards page 0 and the stack (page 1). The situation could arise if a BASIC interpreter and a DOS (disk operating system), or both of these and a video handler, are being used simultaneously. One of the accepted methods of solving this problem involves reserving two areas in random access memory where these pages are "duplicated", giving, for example, E000...EOFF for page 0 and E100...E1FF for the stack. Every time the computer changes from one program to the other the contents of these areas of RAM are swapped with the appropriate contents of pages 0 and 1. This removes any possibility of corrupting the pointers on page zero or the contents of the stack. JSR SWAP software to interchange pages 0 and 1 in a 6502-based system Table 1. The processor leaves the SWAP routine (which it entered using JSR) not by RTS but by JSR! The return a...
Downloading of this magazine article is reserved for registered users only.
Discussion (0 comments)