PeekPokePatch SLJ ------------- last revised: 12/14/99 PPPatch is a program for the SuperCPU which adds hexidecimal numbers to BASIC, patches PEEK, POKE, WAIT, and SYS to use 24-bit arguments, and patches LOAD and SAVE (and VERIFY, for that matter) so that you can load/save directly to/from SuperRAM. Usage: ----- Just load and run. PPPatch adds hexidecimal numbers to BASIC -- just prepend with a $ to specify numbers in hex. For example, ?$11 will print 17, and SYS $8000 is equivalent to SYS 32768. pppatch also allows 24-bit arguments to PEEK, POKE, SYS, and WAIT. For example, POKE $123456,$FF or ?PEEK($01C000). 24-bit addresses must be specified in hexidecimal; 8- and 16-bit numbers can be specified in any manner (i.e. you could also POKE $123456,255). Finally, pppatch patches load and save to work with SuperRAM. To use this feature, you need to specify a hexidecimal load address to LOAD, or start/end addresses to SAVE. If these are not specified, LOAD and SAVE work exactly as normal. Examples: LOAD"BLAH",8 ;Normal load LOAD"BLAH",8,1 ;Normal load LOAD"BLAH",8,$123456 ;Load to $123456 SAVE"BLAH",8 ;Normal save SAVE"BLAH",8,$020000,$046219 ;Block save Note that LOAD and SAVE will load/save across banks. The important thing to understand here is that the extensions will kick in whenever you specify a _hexidecimal_ address, so don't use LOAD"BLAH",8,$1 unless you really want to load BLAH to $000001! Techinical notes ---------------- ML programs can also take advantage of 24-bit loads and saves if PPPatch is present. LOAD and SAVE work exactly the same as before, with two extensions. To do a 24-bit LOAD, - Set the secondary address ($B9) to $FF - Store the start address (destination) bank in $B0 For a 24-bit SAVE, - Set the secondary address to $FF - Store start address bank in $B0 - Store the ending address bank in $AB In other words, SA=$FF "activates" the 24-bit load/save code, and the code fetches the third byte of the 24-bit address from $B0 (and $AB when saving). If SA is not equal to $FF, it will load to bank 0. To check for the presence of the patch code, you can LDA $F7E5. If it equals #$91, then the patch is NOT present. The patch actually adds an additional number type to BASIC. Normally there are floating point numbers and integers; pppatch adds a third type, 24-bit integers. Location $0E normally is set to 00 if a floating- point number is read in, or $80 for integers. PPP sets bit 6 as well, to indicate 24-bit integers. That's how PPP can distinguish between LOAD"*",8,1 and LOAD"*",8,$1. The patch code normally resides at $CE00 or so. Jammon uses a special relocatable version, which also stores the address of a LOAD.