Classic Computer Magazine Archive ANTIC VOL. 4, NO. 11 / MARCH 1986

TECH TIPS


*For machine language programmers, the following listing shows how the 800XL operating system disables BASIC when the machine is booted with the OPTION key depressed:

10 ;DISSABLE BASIC
20 PORTB =   $D301
30       *=  $0600
40       LDA PORTB
50       ORA #$02
60       STA PORTB
70       .END

   In short, the DISABLE routine sets bit 1 of PORT B (54017, $D301). When BASIC is enabled, this location contains 253 ($FD). Otherwise PORTB contains 255 ($FF). You can enable BASIC by reversing the procedure, as illustrated in the next listing.

10 ;ENABLE BASIC
20 PORTB =   $D301
30       *=  $0600
40       LDA PORTB
50       AND #$FD
60       STA PORTB
70       .END
 

*The following two lines will load a binary file from BASIC.

10 OPEN #1,4,0,"D:FILENAME"
20 X=USR(5576)
 

*It's easy to print out a disk directory from the DOS 2 menu. Press [A][RETURN], then type: ,P:[RETURN] (Don't forget the comma before the P).
 

*Use these XIO commands in a Basic program to lock and unlock your files:

10 XIO 35,#1,0,0,"D:FILENAME":REM LOCKS A FILE
20 XIO 36,#1,0,0,"D:FILENAME":REM UNLOCKS A FILE
 

*Roll 'em! You can use a Trak-Ball controller in place of a joystick in almost any program.