Jump to content
IGNORED

Emergency RAMdisk for 64K XL/XE


Rybags

Recommended Posts

In response to an earlier request, here is an "Emergency RAMDisk" for XL/XE computers with 64K or better.

 

All of us have probably been confronted with the case that we've spent hours coding, only to realize that either we forgot to boot DOS first, or that we've inadvertantly corrupted DOS to the point that it no longer works.

 

So, for BASIC users - just type in this listing if that ever happens. Change the line numbers (and the references at 9800 and 9840) if need be.

 

Then just GOTO 9800 and the routine will store the handler at low memory (from $600).

 

To initialize the RAMDisk, enter Z=USR(1536)

 

Then you may save your program. Since only the RAM under the OS is used, it is limited to 14K files. It will return an ERROR - 162 if the file is too big.

It's recommended to SAVE rather than LIST as it generally creates smaller files, and avoids another problem which I'll mention later.

 

Note: the program is fairly simple, and as such only uses the 14K available RAM under the OS. Trying to write a bigger file than 14K will give ERROR 162

 

The device is installed as "Z:". Note that it just overwrites the "P:" device entry. So, to save a BASIC program, just SAVE "Z".

The RAMdisk program listed below only works in write mode (to save typing). The full sized handler with read mode as well is in the Zip file.

 

If you're using, for example, the Atari AsmEdit cartridge, you can enter the data manually. The DATA statements contain hex data which is stored at $600.

 

9800 CLR :DIM D$(2):A=1536:RESTORE 9900:TRAP 9850
9810 READ D$:IF D$="XX" THEN STOP
9820 H=ASC(D$)-48:IF H>9 THEN H=H-7
9830 L=ASC(D$(2))-48:IF L>9 THEN L=L-7
9840 POKE A,L+H*16:A=A+1:GOTO 9810
9900 DATA 68,A9,5A,8D,1A,03,A9,45,8D,1B,03,A9,06,8D,1C,03
9910 DATA 20,27,06,A9,04,8D,00,C0,8D,02,C0,A9,C0,8D,01,C0
9920 DATA 8D,03,C0,20,36,06,60,78,A9,00,8D,0E,D4,AD,01,D3
9930 DATA 29,FE,8D,01,D3,60,AD,01,D3,09,01,8D,01,D3,A9,40
9940 DATA 8D,0E,D4,58,60,51,06,5A,06,5D,06,61,06,5E,06,4C
9950 DATA 36,06,20,27,06,20,13,06,A0,01,60,4C,58,06,60,4C
9960 DATA 58,06,48,20,27,06,AD,00,C0,85,04,AD,01,C0,85,05
9970 DATA A0,00,68,91,04,E6,04,D0,04,E6,05,F0,13,A5,05,C9
9980 DATA D0,D0,02,A9,D8,85,05,20,98,06,20,36,06,A0,01,60
9990 DATA A0,A2,20,98,06,20,36,06,A5,04,8D,00,C0,A5,05,8D
10000 DATA 01,C0,60,00,XX

 

ZDisk.zip

 

Program source code and executables in Zip file.

ZDISK.SRC, ZDISKR.SRC - source code in MAC/65 SAVE format.

ZDISK.OBJ, ZDISKR.OBJ - object code

ZDISK.LST - the program for write only RAMdisk (as listed here)

ZDISKR.LST - program for read/write RAMdisk

ZDISKR.XEX - executable read/write RAMdisk

 

 

Once your program is saved to the RAMDisk, reboot the computer (without turning it off).

 

The easiest way is to just type BYE then hit reset. Or, just Z=USR(58547)

 

Important: reboot with a DOS which doesn't use any of the extra RAM in XL/XE machines. Classic unmodified DOS 2.0 will do fine.

 

Next, either binary load ZDISKR.XEX from the DOS menu, or ENTER "D:ZDISKR.LST" from BASIC (RUN it, then enter Z=USR(1536) to initialize it).

 

From here, the Z: handler with read ability is installed. You can then load your RAM-saved program, or use DOS to copy it back to a normal file.

 

Important note for BASIC: as I mentioned before, a problem with LISTed programs. Sometimes, a line of BASIC will, when listed, spread over more than 3 lines of the display. If a program line is greater than 128 characters, then it will start to overwrite memory at $600 since the input buffer can span that area.

For this reason, it is best to SAVE your BASIC program to the RAMdisk instead of LISTing it.

 

To get rid of the RAMdisk, just press RESET.

Edited by Rybags
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...