Auto-running a program from a floppy

10 posts / 0 new
Last post
Offline
Last seen: 3 years 6 months ago
Joined: Sep 26 2019 - 16:46
Posts: 148
Auto-running a program from a floppy

My programming/use of the Apple II is getting rather rusty....

 

I'm in the process of eliminating some hardware issues (color missing) on my II+ motherboard and have copied (from some listing I found) and saved a small color bar type test program. Since my keyboard is disconnected when working on the computer it would be great to have it run automatically when a disk with it on would boot.

The program is in Applesoft basic, I've saved it on a DOS 3.3 disk (5.25") and my II+ has an autoboot ROM.

Offline
Last seen: 5 months 1 week ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
Fuji wrote:

[quote=Fuji]

My programming/use of the Apple II is getting rather rusty....

 

I'm in the process of eliminating some hardware issues (color missing) on my II+ motherboard and have copied (from some listing I found) and saved a small color bar type test program. Since my keyboard is disconnected when working on the computer it would be great to have it run automatically when a disk with it on would boot.

The program is in Applesoft basic, I've saved it on a DOS 3.3 disk (5.25") and my II+ has an autoboot ROM.

[/quote]

 

RENAME it to "HELLO" (no quotes).  Chances are that is what the startup program is set to on that disk ("INIT HELLO" was pretty much a standard).  If there is already a file named HELLO, either delete it or rename it to something else.

 

 

 

Offline
Last seen: 3 years 6 months ago
Joined: Sep 26 2019 - 16:46
Posts: 148
Aha! That sounds familiar and

Aha! That sounds familiar and makes sense, because many of my disks have a "menu" program called HELLO, which automatically starts after booting and lets you run programs by pressing a letter (A, B, C, etc.) instead of the usual "RUN PROGRAM NAME".

I'll give it a go. Thanks for the tip!

Offline
Last seen: 1 week 3 days ago
Joined: Dec 19 2008 - 21:01
Posts: 400
Fuji wrote:

[quote=Fuji]

Aha! That sounds familiar and makes sense, because many of my disks have a "menu" program called HELLO, which automatically starts after booting and lets you run programs by pressing a letter (A, B, C, etc.) instead of the usual "RUN PROGRAM NAME".

I'll give it a go. Thanks for the tip!

[/quote]

 

I think you can just do an INIT HELLO (or whatever you want to call it) on a new disk with your program loaded in memory and it will save it as HELLO automatically.

 

Offline
Last seen: 3 years 6 months ago
Joined: Sep 26 2019 - 16:46
Posts: 148
Late reply... (I've been

Late reply... (I've been preoccupied troubleshooting/repairing my II+ clone -finally working now!).

 

INIT HELLO  works perfectly!

So "HELLO" is a specific filename which DOS recognizes to auto-run? In other words, if I use INIT GOODBYE it won't auto-run whatever was in memory at the time?

 

One strange thing: apparently there were other DOS versions than Apple's DOS 3.3 and one of them shows a track number display at the bottom right hand corner of the screen. But booting with that disk, then doing an INIT HELLO didn't work (I think I got an I/O ERROR). Does anyone know anything about that DOS version and what I should do in order to format disks with it?

 

On  a sidenote, I've got this very cool program-selector on many of my disks (named HELLO of course, in order to auto-start) which gives each file on the disk a letter (A.B.C etc.) and allows you to run, load, lock etc. with a single keypress. It's been so long that I don't remember its source, but here it is for others to enjoy. Maybe someone recognizes it and can tell more about where it came from?

0  REM     06/06/83100  TEXT : HOME :D$ =  CHR$ (4): PRINT D$"CATALOG":B =  PEEK (37) - 2: IF B > 22 THEN B = 22110 T = 0:CH = 4: FOR CV = 5 TO 23: GOSUB 1000: IF C <  > 160 THEN  POKE P - 1,219: POKE P,T + 193: POKE P + 1,221:T =T + 1:S = CV120  NEXT CV: VTAB 24:A$ = "TYPE LETTER TO RUN, OR LOAD=1 LOCK=2 UNLOCK=3 DELETE=4 EXIT=5...."130 B$ = "RUN": HTAB 1: PRINT  LEFT$ (A$,39);:A$ =  MID$ (A$,2) + LEFT$ (A$,1):K =  PEEK ( -16384): IF K < 128 THEN  FOR K = 1 TO 75: NEXT K:K =  FRE (0): GOTO 130140  POKE  - 16368,0:K = K - 176: IF K < 1 OR K > 5 THEN 300200  HTAB 1: CALL  - 868: IF K = 5 THEN  END210  PRINT "PRESS 'LETTER' YOU WISH TO ";: IF K = 1 THEN B$ ="LOAD"220  IF K = 2 THEN B$ = "LOCK"230  IF K = 3 THEN B$ = "UNLOCK"240  IF K = 4 THEN B$ = "DELETE": FLASH250  PRINT B$;: CALL  - 198: NORMAL: GET K$:K =  ASC (K$) - 48300  IF K < 17 OR K > T + 16 THEN 130310 CH = 1:CV = S - T + K - 16: GOSUB 1000: IF C = 194 AND (B$ = "RUN" OR B$ = "LOAD") THEN B$ = "B" + B$320  FOR CH = 6 TO 39: GOSUB 1000: B$ = B$ +  CHR$ (C): NEXT CH: HTAB 1: CALL  - 868: PRINT B$: PRINT D$;B$: GOTO 1001000 C1 =  INT (CV / 8):C2 = CV - C1 * 8:P = 1024 + 128 * C2 + 40 * C1 + CH:C =  PEEK (P): RETURN

 

 

Offline
Last seen: 3 hours 40 min ago
Joined: Jun 18 2010 - 13:54
Posts: 787
 

 

Fuji wrote:

So "HELLO" is a specific filename which DOS recognizes to auto-run? In other words, if I use INIT GOODBYE it won't auto-run whatever was in memory at the time?

 Nothing magical about HELLO. If you INIT GOODBYE it will just name the file GOODBYE and run it when booted. Or any other file you wish to later name GOODBYE.

cjs
cjs's picture
Offline
Last seen: 1 year 2 months ago
Joined: Mar 4 2020 - 22:20
Posts: 30
INIT and LEVI

The program that is auto-run when a disk is booted is whatever name was specified as a parameter to the INIT command when the disk was initilized. So if you INIT GOODBYE, the command RUN GOODBYE will be executed when the disk is booted. (This can be changed to BRUN with a POKE to tweak DOS before you INIT.)

The Applesoft or Integer BASIC program in memory is also written to disk under the name you give to the INIT command, but that's orthogonal. You can later delete the program (in which case nothing will be run) or replace it with a different program. The only thing DOS cares about on bootup is the name.

Chapters 2 through 4 of The DOS Manual give full details of all the DOS commands and are a pretty quick and easy read.

The program selector program you're talking about is common; I've also seen it on disks under the name LEVI. I've no idea where it comes from (though I remember it from my own use of Apple IIs in the early 80s). In the hope of solving the mystery, I've asked a question on the Retrocomputing Stack Exchange.

Offline
Last seen: 3 years 6 months ago
Joined: Sep 26 2019 - 16:46
Posts: 148
Cool! Thanks for clearing it

Cool! Thanks for clearing it all up.

I'll take a look in the DOS manual to learn more.

Do report back if you learn anything more about the program selector's origins. I remember it saved a lot of typing back in the days, and it would be interesting to hear who came up with the idea.

Offline
Last seen: 3 hours 40 min ago
Joined: Jun 18 2010 - 13:54
Posts: 787
Plenty of "selectors" for ProDOS    

The program above looks fine for DOS 3.3.

There's also plenty of "selectors" for ProDOS such as ProSel, Squirt, etc.

Offline
Last seen: 3 years 6 months ago
Joined: Sep 26 2019 - 16:46
Posts: 148
Thanks! I didn't know about

Thanks! I didn't know about the ones for ProDOS, but then again I actually never did understand (or take the time to learn rather) ProDOS and stuck with standard DOS 3.3 (or the better alternatives).

Log in or register to post comments