Classic Computer Magazine Archive ANTIC VOL. 4, NO. 10 / FEBRUARY 1986


Clean, handy XL/XE BASIC control

by IAN CHADWICK, Antic Contributing Editor

Switch disabled BASIC back on from DOS, in convenient and elegant style. This very short BASIC program creates a mini-binary file which, when loaded from DOS, will turn on the internal BASIC in Atari XL and XE computers.

To disable the BASIC language built into Atari XL and XE computers, you must hold down the [OPTION] key during the first few seconds of a disk boot. This doesn't seem like a terribly difficult task. But sometimes I forget, or I'm too slow getting the key pressed down, or my touch is too light. Whatever...I end up in BASIC almost often as not!

Rather than reboot the system, you can disable BASIC with a POKE to 1016, followed by pressing [RESET]. Any non-zero number will do. Once the POKE is set, pressing [RESET] forces a DOS load. If you try to use menu option B, you'll get the No Cartridge message. I think this method is simpler and cleaner than turning the computer off and on again.

A bigger chore is getting BASIC back again after you've disabled it. This isn't just a simple POKE – you can't POKE from DOS anyway. It requires a few extra changes to memory to re-enable the internal BASIC. The solution is in Listing 1.


To return to BASIC properly, you need to load the BASIC RAM flag at 1016 ($03F8) with zero, the cartridge checksum register at 1003 ($03EB) with 82 ($52), and finally PORTB at 54017 ($D301) with 253 ($FD). PORTB is the memory management location which tells the operating system whether or not BASIC ROM is enabled.

If BIT 1 of PORTB is zero, then BASIC is enabled. End with a jump to the OS warmstart vector at 58484 ($E474). The actual warmstart routine is at 49808 ($C290), but the vector is the proper entry point.

Type in Listing 1. and SAVE a copy before you RUN it. Now RUN the program and go to DOS. Use DOS option K to binary save memory at locations $600 to $612, with a RUN address at $600 – don't type the dollar signs. You can name your file anything, I call mine simply GO.EXE. (Antic Disk subscribers will find this listing titled GO.EXE.) Consult your Atari DOS manual if you'd like more details about option K.

Now when you want to return to BASIC, (even if you pressed the [OPTION] key during the boot or POKEd 1016), use the DOS L command to run GO.EXE. It's only one sector long and easily tags onto any file where you might need it.

The nice thing about this method of enabling and disabling BASIC is that it requires no resident routines in memory and it's simple and easy to remember and understand.

GO.EXE Download