EUG PD


Saving Memory Direct

 
Published in EUG #1

Saving Function Keys

If you ever get tired of defining function keys each time you start programming then a solution is to save the keys onto tape. When function keys are programmed, the information is stored in the Electron's memory at addresses &B00 to &BFF. So by typing:

   *SAVE "KEYS" 0B00 0BFF (RETURN)

they can be stored on cassette. To load, enter:

   *LOAD "KEYS" 0B00 (RETURN)

and they are ready for use.

Saving Graphic Screens

Graphics can be stored in the same way. Screen information is held in RAM between &3000 and &7FFF, depending on the mode. So if the image you wish to save is in Mode 5 then:

   *SAVE "MYPIC" 5800 7FFF (RETURN)

would do the trick. To recover the picture from tape, enter:

   *LOAD "MYPIC" 5800 (RETURN)

Both loading and saving should be done in the same mode. One point to bear in mind is that any commands appearing on the screen will also be saved, unless you work out the screen memory the command occupies and leave it out. Here are the addresses for all the modes:

Mode Start End
0, 1, 2&3000&7FFF
3 &4000 &7FFF
4, 5 &5800 &7FFF
6 &6000 &7FFF

This method of screen loading is usually used in games programs to save memory.

Appendix

Disk owners need not worry about commands disrupting screen display during saving or loading but tape users can avoid this problem by using two special VDU codes thus:-

   VDU 21 (RETURN)
   *SAVE (name) (start) (end) (RETURN)
   VDU 6 (RETURN)

VDU 21 disables the VDU drivers so no tape OS messages or prompts will appear on screen - so you must remember to press RETURN when saving begins. VDU 6 enables the VDU drivers once again. The save and load routines are best placed in procedures.

Jack Warburton, EUG #1

Jack Warburton