Według dokumentacji, przez PORTB: ->link<- Bit 1 controls BASIC; if 0, BASIC is enabled, if 1, it is disabled and the 8K RAM space enabled for program use. If you disable BASIC within a BASIC program, you lock up.
Według tej strony, trzeba zrobić więcej, aby być pewnym, że wyłączenie nic nie zepsuje: ->link<- Najlepiej to zrobić dodatkowym blokiem INIT, przed załadowaniem programu głównego, ale... według tej dyskusji, SpartaDos włączy Basic: ->link<-
Dodatkowo wyłączenie BASICa nie zmniejszy Memtop, który jest używany przez Basic, ale według dokumentacji też przez OS ->link<- dla OS, więc trzeba Memtop zmniejszyć "ręcznie" zawsze, czy tylko gdy korzysta się z trybów graficznych OS? A może Memtop jest używany przez alternatywne OSy i gdy się go nie zmniejszy, coś się wywali?
Bill Wilkinson once made a small type-in listing available in Compute! magazine to switch off built-in Atari Basic via software (no need to hold down the Option key anymore). The routine used $0400-042C and only switched off Basic, nothing more, nothing less. It was then spread via dozens of magazines and I also used it for many years in front of ML programs that required Basic to be off. Some ML programs still showed garbage on the screen, which I could not explain, mostly utility programs and applications (paint programs, font creators, etc.) and so I lived with that.
In 2016 we had two games in the Abbuc Software contest that also showed garbage in the titlescreen or in the game, when this routine was used instead of booting with the Option key. So I contacted Fandal and in the case of "DYE" he told me, that this game also requires the RAM under Basic to be cleared. He did then send me a new/updated routine that used $0400-043E and switched Basic off + cleared RAM under Basic.
In the case of paratroopers, errrmm, Rain of Terror (ROT) this routine still did not help and the game still showed garbage when not pressing the Option key (while it was fine and without garbage with Option held down). So, evil as I am, I contacted Fandal again and he told me, that ROT also needs the zeropage to be cleared to work correct. He did then send me a new/updated routine that uses $0400-0447 and switches Basic off, clears RAM under Basic and clears the zeropage. I am using this routine (CLEARZP.COM) since then and in the last three years I have not found any ML program that did not work with it or showed garbage, so maybe this is the perfect solution ? Or are there any other things that the OS in XL/XE does when holding down the Option key ? Yep, I am too lazy to always hold down the Option key, still I do not want to install a patched OS...
Sidenote: Allthough the routine uses page 4, as soon as the routine executed its tasks, page 4 is available then for the program (in other words, it is no problem that the short routine and the program both use page 4)...
@CharlieChaplin According to ->link<- : The program should not overwrite system page [...] 4 ($400-$4ff) [...] Reason: These memory locations are used by software driven speeders and file loaders of various devices. If you overwrite them the speeder or loader will crash and the user will have to play around with configuration settings and in the works case will not be able to run your program at all. are no problem.
@Ilmenit: I think when JAC wrote that, he meant that the A8 programs should not use page 1 AND page 4 AND page 5 AND page 6 at the same time. One of these pages should be no problem (but not all of them).
Besides: - HIAS ultraspeed OS+ (or whatever it is named) uses page 1 NOT page 4 for acceleration
- the turbo 1050 drive and compatibles (TOMS, etc.) uses page 1 or page 6, but NOT page 4 for acceleration. Hyper-XF-OS uses page 1 or page 6, but not page 4 for acceleration
- all DOS 2.x versions (with built-in speeder support) I have do NOT use page 4 for acceleration
- some external software speeders (e.g. from Bob Woolley) for ultraspeed or XF highspeed use page 6 and RAM under the OS but NOT page 4
- afaik, SIO2SD turbo mode uses page 5 or page 7 but not page 4 (not absolutely sure, since I switched turbo mode off in all of my four SIO2SD devices)
- all bootloaders I am using (e.g. Picoboot, Autoload, Avalon Boot, Fender's 3-sector menu, etc.) sit in the first three sectors of a disk and do not provide any speeder (then they would not fit into the first three sectors / bootsectors of a DOS 2.x disk) and they work fine with this page 4 routine
- the gamedos versions like MypicoDOS, Speed Start Init. and several others which support speeders also work fine with this page 4 routine
- my AVG carts. and their built-in XEX loader also work fine with this page 4 routine, the SIDE loader for AVG cart. also works fine with this page 4 routine; my Ultimate-carts. and their XEX-loader also work fine with this page 4 routine. (I do not own My-IDE, SIDE/SIDE-2, UNO-cart, etc.) Even the one SIC! 2Mbit (256kb) cart. I have loads XEX programs with this page 4 routine fine (I have not created any boot-menus with XEX files for the Atarimax 1MBit and 8MBit carts. myself, so do not know if they would work fine with this page 4 routine).
- I don't have U1MB or similar RAM upgrade with built-in XEX loader, so I cannot comment on that; I don't have third party OS with built-in XEX loader so I also cannot comment on that
etc.
As said before, the small page 4 routine only uses page 4 to switch off Basic, right after that page 4 is fully available again. I use this small routine since several years with all my (ultraspeed) Speedy 1050 and (ultraspeed) Hyper-XF drives without any problems but then again, I am only using standard XL-OS Rev. 2 (and OS-B when required) and no third party OS (like QMEG-OS, SPOS, US+OS, etc.). And my Atari 800 XL computers only have RAM upgrade (512k), stereo-Pokey board and XL-OS + OS-B and nothing else (no U1MB, VBXE, Rapidus, Evie, Sophia, Antonia, etc.).
From $0480 upwards I guess ?!? Merged my page 4 (Basic-off) routine with Abyssus and it still loads fine with Xboot (the page 4 routine uses $0400-0447).
Xboot (initializer) was used, since Abyssus uses memory from $0800 upwards and I was too lazy to search for a DOS, gamedos or bootloader that works with such a low memlo. (Found DOS 2.XL by Thor [thorfdgb at Atari Age] which has a memlo of $0794, but it therefore uses RAM under the OS.)