Over the years I have played with various HELLO programs on the Apple II to find something curated (not automatic/catalog driven) which is easy to manage for a wide variety of disk contents. I have put this one together which embodies a few tricks and some assembler code to speed up the slow parts. The Applesoft HELLO program loads HELLOBIN which does 2 things…. it reads the VTOC and calculates the free sectors on the disk making it part of the display. There is also a small subroutine inside it that will test the keyboard strobe to see if a key has been pressed. When using the strobe subroutine it’s important to use it in the tightest loops of any applesoft program. I should also mention I have only tested this on machines with 48K or more of ram…. it’s one of the shortcut assumptions. I like tight code which was also one of my goals. HELLOBIN is 2 sectors and the Applesoft uses 5 sectors. Watch out for the hard coded LoBytes in the assembly program (look for <====) if you decide to relocate it; I didn’t bother to figure out the proper directive for the LISA assembler. Lastly, the HELLO program includes a decent screen saver feature. Without further ado here are the listings…..
88 HOME
99 POKE 49233,0: POKE 32127,32
100 DATA "Copy A","RUNCOPYA"
110 DATA "Copy II+", "BRUNCOPY"
120 DATA "Locksmith", "BRUNLOCKSMITH 4.1"
130 DATA "Program Editor", "BRUNEDITOR"
140 DATA "Cat Arranger" , "BRUNCAT ARRANGER"
150 DATA "Pretty CAT", "RUNPRETTYCAT"
160 DATA "Execumatic", "RUNEXECUMATIC"
170 DATA "Renumber", "RUNRENUMBER"
190 DATA "ZIP Chip","RUNZIP"
200 DATA "END","END" : DIM A$(30),B$(30):B = 1
201 READ A$(B),B$(B): IF A$(B) < > "END" THEN B = B + 1: GOTO 201
250 XX = 1000:TT = 0:D$ = CHR$ (4):L$ = CHR$ (13)
260 PRINT CHR$ (4);"BLOADHELLOBIN": CALL 787
265 D = PEEK (43624):S = PEEK (43626):F = PEEK (6) + 256 * PEEK (7)
300 TEXT : HOME : HTAB 26: PRINT "S:";S;" D:";D;" F:";F
320 FOR C = 1 TO B - 1
330 VTAB 2 * C + 1: HTAB 10: PRINT CHR$ (C + 64)") ";A$(C): NEXT C
340 VTAB 23: HTAB 38:TT = 0
350 CALL 768:K = PEEK (77):TT = TT + 1: IF TT > XX THEN 900
370 IF K = 155 THEN TEXT : HOME : END
380 IF (K > 179) AND (K < 184) THEN C$ = "PR#" + CHR$ (K): GOTO 800
390 IF (K = 177) OR (K = 178) THEN C$="CATALOGD" + CHR$ (K): GOTO 800
400 K = K - 192: IF (K > B - 1) OR (K < 1) THEN 350
410 HOME : VTAB 12: PRINT " Loading....";A$(K): PRINT D$;B$(K): END
800 TEXT : HOME : PRINT "Exiting...": PRINT L$D$C$L$: END
900 GR : HOME
920 COLOR= RND (1) * 16
930 X1 = RND (9) * 34:X2 = X1 + 2 + RND (9) * 4
940 Y1 = RND (9) * 34:Y2 = Y1 + 2 + RND (9) * 5
950 FOR V = Y1 TO Y2: CALL 768: IF PEEK (77) > 0 THEN 300
951 HLIN X1,X2 AT V: NEXT V: GOTO 920
ORG $300
KEYIN LDA $C000
BIT $C000
BPL NOKEY
STA $4D
BIT $C010
RTS
NOKEY LDA #$00
STA $4D
RTS
VTOC LDA $AA6A ; Load slot number
ASL ; Multiply by 16
ASL
ASL
ASL
STA SLOT ; Store in IOB
LDA $AA68 ; Load drive number
STA DRIVE ; Store in IOB
LDA #$03 ; High byte of IOB
LDY #$5B ; Low byte of IOB <===
JSR $03D9 ; Call RWTS
COUNT LDA #$38 ; Walk the bitmap
STA $4C
LDA #$60
STA $4D
LDA #0
STA $4E
STA $4F
LDY #0
LOOP1 LDA ($4C),Y
STA $50
LDX #8
LOOP2 LSR $50
BCC SKIP
INC $4E
BNE SKIP
INC $4F
SKIP DEX
BNE LOOP2
INY
CPY #140
BNE LOOP1
LDA $4E
STA $06
LDA $4F
STA $07
RTS
IOB HEX 01 ; IOB type indicator
SLOT HEX 00 ; Slot number * 16
DRIVE HEX 00 ; Drive number
HEX 00 ; Expected volume
HEX 11 ; Track number
HEX 00 ; Sector number
HEX 6C ; Low byte of DCT <===
HEX 03 ; High byte of DCT
HEX 00 ; Low byte of buffer
HEX 60 ; High byte of buffer
HEX 00 ; unused
HEX 00 ; unused
HEX 01 ; Command code
HEX 00 ; Return error code
HEX 00 ; Return volume
HEX 00 ; Previous slot
HEX 00 ; Previous drive
DCT HEX 00
HEX 01
HEX EF
HEX D8
END