Dazu auch ein Topic im AA-Forum:
https://forums.atariage.com/topic/23801 ... y-its-own/
mit einigen Sources in Assembler und Mad Pascal. Bill Wilkinson (Autor von Inside Atari Basic, etc.) hat im Compute! Magazin mal eine kurze Routine released (XEX hat ca. 57 Bytes) die das Basic automatisch abschaltet. Hier der Assembler Sourcecode dazu:
Code: Alles auswählen
org $0400
;
L0400: lda PORTB
ora #$02
sta PORTB
lda #$01
sta BASICF
lda #$0C
jsr OpenE
lda #$C0
sta RAMTOP
lda #$03
OpenE: sta IOCB0+ICCOM
lda #<Name
sta IOCB0+ICBAL
lda #>Name
sta IOCB0+ICBAH
ldx #$00
jmp CIOV
Name: .byte "E:"
.byte $00
;
org $02E2
;
.word L0400
;
-----
Siehe auch JAC's Seite mit vielen hilfreichen Tips:
http://www.wudsn.com/index.php/producti ... rials/tips
=> The program should switch off BASIC automatically if it requires BASIC to be disabled.
Reason: Don't force the user to remember when to press OPTION and when not.
Remember that the default in many modified operating systems and emulators is that BASIC is off. On a real computer, the default is the BASIC is on. So if the area $A000-$BFFF is used already during loading, no data will be stored in the RAM, and the program will typically crash upon start. The user can be relieved from controlling BASIC by adding the following short INI segment at the beginning of the program file. It saves some bytes using the OPEN and CLOSE vectors from the official E: handler table instead of the CIOV.
Code: Alles auswählen
org $2000 ; Can be overwritten by the main program
.proc loader ; Disable BASIC
lda #$c0 ; Check if RAMTOP is already OK
cmp $6a ; Prevent flickering if BASIC is already off
beq ramok
sta $6a ; Set RAMTOP to end of BASIC
sta $2e4 ; Set RAMSIZ also
lda $d301 ; Disable BASIC bit in PORTB for MMU
ora #$02
sta $d301
lda $a000 ; Check if BASIC ROM area is now writeable
inc $a000
cmp $a000
beq ramnok ; If not, perform error handling....
lda #$01 ; Set BASICF for OS, so BASIC remains OFF after RESET
sta $3f8
ldx #2 ; Close "E:" before re-openining it again
jsr editor
ldx #0 ; Open "E:" to ensure screen is not at $9C00
editor lda $e401,x ; This prevents garbage when loading up to $bc000
pha
lda $e400,x
pha
ramok rts
ramnok inc 712 ; Add your error handling here, there still is a ROM....
jmp ramnok
.endp
ini loader ; Make sure the loader is executed before the main program is loaded
org $2000 ; Start of main program