Page 1 of 1
Running 6502 assembly program on boot for the Apple //e
Posted: Mon Nov 10, 2014 3:45 pm
by Johnny Starr
This may be the wrong forum, but I'm hoping I catch the attention of an old-school Apple ii dev.
I have been writing so programs for the Apple //e and I'm really enjoying it. I've broken away from
Atari 2600 development for a bit to see what a real machine can do.
I've played around with Applesoft Basic in the past, and have written some crummy games with it. Now that I know how to write 6502 assembly, I'm wanting to write a homebrew game for the Apple //e.
I'm not sure though what needs to be done to run the application on boot. Is it a situation where you do a BRUN / BLOAD somehow?
Re: Running 6502 assembly program on boot for the Apple //e
Posted: Mon Nov 10, 2014 10:47 pm
by ChuckT
It has been since high school that I've touched an Apple II, II+ or Apple IIe.
What I remember was that memory was divided up into two or three segments depending on how much memory you had which served as a kind of copy protection.
I used Google to find your answer:
http://www.landsnail.com/a2ref3.htm
You may also need to find a proper memory map of the Apple of your choice.
Use Google as your friend.
Re: Running 6502 assembly program on boot for the Apple //e
Posted: Tue Nov 11, 2014 12:48 am
by nyef
A quick bit of searching via google leads to
http://en.wikipedia.org/wiki/Apple_DOS#Boot_loader the text of which suggests that having a BASIC program file named "HELLO" might suffice for an automatic start with stock DOS. I don't know if it would work for a binary program. You could also patch the DOS image on the disk to load a different file, or if you're going to be working in assembler anyway you might go with a substantially customized startup procedure.
It's been a while since I've done any serious apple2 work, so I'm more than a bit rusty on the details, I'm afraid. I should have access to some of my old manuals in about a week, though.
Re: Running 6502 assembly program on boot for the Apple //e
Posted: Fri Mar 06, 2015 8:14 am
by KC9UDX
I have a disk which boots a machine code program I wrote. There is the classic "HELLO" file ('cept I named mine "IALIZE") but it's type B instead of type A or I. It runs on boot. Frankly, I have no idea how I did that.
Re: Running 6502 assembly program on boot for the Apple //e
Posted: Fri Mar 06, 2015 9:25 am
by barrym95838
For a ][+ or newer:
Code: Select all
NEW
10 TEXT : HOME : PRINT "... INITIALIZING ... ONE MOMENT ..."
20 PRINT CHR$(4)"BRUN GAME"
SAVE HELLO
For an original ][:
Code: Select all
NEW
10 TEXT : CALL -936: PRINT "... INITIALIZING ... ONE MOMENT ..."
20 PRINT "BRUN GAME" : REM INVISIBLE CTRL-D BEFORE BRUN
30 END
SAVE HELLO
Actually, the second one is the most portable, although not the most readable.
Mike B.
Re: Running 6502 assembly program on boot for the Apple //e
Posted: Fri Aug 15, 2025 2:42 am
by Virtual1
I have a disk which boots a machine code program I wrote. There is the classic "HELLO" file ('cept I named mine "IALIZE") but it's type B instead of type A or I. It runs on boot. Frankly, I have no idea how I did that.
There's a POKE you can do to change the file type it expects when it runs the default program name. And when you INIT a disk, you don't have to say "INIT HELLO", it can be any legal name, and that's the file name it'll search for on boot.
so find the poke and do it, INIT whatever, (and it'll save the BASIC program as whatever. then delete whatever and bsave your binary with the whatever name.
though just having a basic program BRUN it is definitely the easier option.
there is also a hook inside DOS that's just BEGGING to be used for this btw. It does a useless call RIGHT before loading and running the hello program. Replace that with a call to some ML embedded in one of the unused little nooks inside dos, and the startup ML doesn't even have to be a FILE. (and is also very hard to stop) Good place for something that requests a password for your disk

Re: Running 6502 assembly program on boot for the Apple //e
Posted: Mon Dec 22, 2025 5:41 am
by TMorita
If you want to run a program on boot, then you need to burn it into an EPROM and put it on an expansion card.
If the program is less than 256 bytes, you can put it map it into $CX00 where X is the slot number.
The first few bytes need to be the ID of a disk controller so the ROM will jump to the code.
If the program is >256 bytes but <2K, then you probably want to map it to $C800
You still need some minimal code to $CX00 to jump to $C800.
Toshi