Hacker News new | past | comments | ask | show | jobs | submit login
Apple II DOS source code (computerhistory.org)
228 points by coloneltcb on Apr 1, 2016 | hide | past | web | favorite | 51 comments



Hmmm, whole article about people reverse engineering apple dos, and no mention of "Beneath Apple Dos"? That ended up being one of my apple ][ books that nearly fell apart.


Came here to point this out.

My Apple ][ shipped with "Beneath Apple DOS", the Apple ][ programmer's guide, and the Apple ][ Reference Manual which included a full fold-out schematic!

The original Apple ][ was more than a computer, it was like a degree in computer science if you actually studied what shipped with it.


Woz autographed my spiral bound Apple ][ reference manual "Have fun with your Apple! -WOZ", so I followed his instructions, line by line.


Don Worth and Pieter Lechner were idols of mine at the time. I would never have been able to crack a single floppy back then without this wonderful book.

D5 AA 96 forever.


Another interesting side effect of Apple DOS is the extraordinary fertile ground it created for software companies to copy-protect their applications.

Piracy was already a big deal back then and pretty much every single software publisher on the Apple ][ had developed their own copy protection mechanism by simply hijacking the low-level vectors of Apple DOS.

Some of these copy protections were quite frankly amazing in ingenuity.


I spent so many hours watching The Locksmith [1] go "Read..." "Analyze..." "Write..." nibble by nibble, sector by sector.

[1] ftp://ftp.apple.asimov.net/pub/apple_II/documentation/applications/misc/Locksmith%20User%20Manual.pdf


well I guess I will admit to the hours friends and I spent hacking out Wizardry and other games. Wizardry was a pain because it was in effect booting its own runtime, a pascal based one at that. (think it was wizardry that did this). Between the days of NDD on PCs and messing with code on Apple ][ I never realized how much my love for programming was being developed


Yes, Wizardry was the first game to ship that was written in Pascal UCSD if I recall correctly.

The boot sequence was pretty unmistakable (clear screen, switch to 80 columns, cursor in the upper left corner) but quite novel at the time.

Here it is, if you want to experience it yourself:

http://www.virtualapple.org/wizardrydisk.html


The strategically-placed hole-punch through the diskette will always be my favorite.


My own favourite was the quarter track 'spiral' protection! It was amazing, and sounded so cool :-)


When I worked in that area for Apple][ copy protection we had a separate card that was plugged into the expansion bus.


My mind is blown that they used punch cards to write Apple II software in the early days.


Only very, very early system bootstrapping stuff. Beyond that, most software was written on the machines themselves. Like this guy, who is also on HN

http://www.atariarchives.org/deli/cottage_computer_programmi...


Thank you for that reference. Paul Lutus is a childhood hero.


He wrote a cool book about sailing, also. I read it in q3 last year, then quit my job and did an atlantic crossing in november. I am now cottage programming.


Woz is fairly well known to have hand-assembled (on paper) the ROM monitor for the Apple II, which he then used to code Integer BASIC.


Cool article. Must of been one hell of an smile on their face every time DOS ran on the machine properly after being assembled on a separate machine.

Q̶u̶e̶u̶e̶ Cue the person looking at source code mentioning something along the lines of "this is real engineering".


> Queue the person looking at source code mentioning something along the lines of "this is real engineering".

Well it's assembly, so I'm looking at it and thinking, "Yup, that's assembly!"


Operating systems today are still marvelous feats of engineering despite their quirks (such as legacy "features" like ANSI and UCS-2 "Unicode" in Windows), the fact that in the past we could fit an entire operating system AND running applications in one megabyte of RAM is remarkable!


Like my sibling poster said, a full megabyte would have been the sheerest luxury. After the ROM was mapped into memory on startup, my C64 had 38 kB available for programs. It is flat-out amazing what people did with that memory, including office software, networking and of course games.

Keep in mind that the Apple II originally shipped with 4 kB.


There are still amazing things being done right now, especially in demoscene.

I especially like this: http://www.pouet.net/prod.php?which=30244 [1]

Everything (including graphics and music) fits in 200kb (177kb exactly)

While it was made almost 10 years ago it is still very impressive.

[1] If you can't or are afraid to run executable (antivirus programs might complain due to compression program they used), here's video of it: https://www.youtube.com/watch?v=KMfyrnu3n_c


I was always amazed by .kkrieger[1]

You get an FPS complete with 3D engine... dynamic lightning IIRC (!), music, textures...

... in 96kb.

Granted, most of it is procedural but still it's a very very impressive piece of code.

I've always thought that demoscene guys were on a whole different engineering league

[1] http://www.pouet.net/prod.php?which=12036


As I think back on the hardware, I am amazed that my old C=64 could not only run a word processor, but it could spell check. The machine only had 64 kb of RAM and the disks were so glacial that you couldn't touch them much at all and maintain anything like a usable speed.


The Sinclair Cambridge ZX-80 (sold here as the Timex computer or somesuch) shipped with 1kB of RAM. That said, it wasn't really usable for much beyond programmable calculator kinds of stuff. With a 16kB expansion it was pretty awesome.


My first computer! I was programming in Z-80 assembler, typing in listings from magazines, with no way to save the code. So once the machine was switched off, the program was wiped and it had to be entered again. It's one way to learn the importance of accuracy - after hours of typing hex digits, to have one type cause the program to blow up, and have to start all over.


I'm gonna' need you to retype this comment from the beginning as there's a typo and thus, I can't read it.


Are you going to blow up as well?



My IIGS with a transwarp and a CFL disk boots faster than my win7 4.5Ghz machine with a samsung 850 too...


Megabyte? Luxury! Lots of cool systems fit in 64KB, including PDP-11 UNIX.


I thought the PDP-11 had 128k.


You could get a pdp 11s with a range of memory sizes all of the ones I worked on had less than 128k


("Queue the person ..." - "Cue")


Updated, thanks.


"Must of" should be "must've".



> Must of

have


The Wikipedia entry for Jef Raskin has further discussion of "Notzo Basic". It was a project by Jef that was never completed.



I remember 6502 assembly fondly, so easy to learn and remember, but so full of tricks you had to learn as well.


I don't remember any tricks from working with NES 6502 assembly, what tricks do you mean?


Could you write self-modifying code on a NES? If not (or not typically) that would get rid of most of the crazier stuff.


Code on consoles of that era is typically executed directly from ROM, so you'd have to first copy it to RAM, which was rather limited (only 2 KB I believe on the NES).


Some carts also had expansion RAM in them also


Reminds me of all those warm starts on a cold late 3D0G night.

TIL the name of that band [1] was suggested by the June Fairchild, the Cheech and Chong "Ajax Lady" [2].

[1] https://en.wikipedia.org/wiki/Three_Dog_Night#Band_name_orig...

[2] https://www.youtube.com/watch?v=WREo-_R9uyc


Wow! I remember reading 3D0G in one of the many apple manuals that came with my Apple ][+ I filed it away in my memory and used it every time I accidentally ended up with a * prompt. It feels good to know others have fond memories of those days too.


The earlier Apple ]['s would dump you into the monitor instead of Applesoft when you hit the RESET key, after resetting the CIN and COUT vectors which disable DOS, so you had to type 3D0G to warm start DOS, hook them back up and re-enter BASIC.

The RESET key was so unfortunately placed, and earlier models had very soft springs, which Apple eventually stiffened in later models, so there was a whole industry of after market RESET key protectors [1] (like a square plastic tube that slides over the key so you have to stick your finger down into it to RESET), to prevent you from having to type 3D0G so often.

[1] http://apple2history.org/history/ah13/#13


I think the ][+ was the first one with the stiffer reset spring.

The other thing that tripped up newbies was the power light on the keyboard that wasn't a switch (you had to reach around the back left of the unit and fumble for it).


I run Debian unstable, wryly observing that I get nervous if any package on my machines is more than 6 months old.

While I appreciate that some of this code could possibly be re-purposed for embedded systems or micro-controllers with similar memory constraints, it seems these problems have been well solved several times over in the past 38 years. Yes, there's a surprising amount of 65xx development still going on, but again, is this going to fill any gaps that free software doesn't already cover? Note, I'm not saying this isn't interesting - it very much is.

But, at the risk of sounding churlish, is this hubris, or is there some justification for the constraint:

  > ... we are pleased to make available the 1978 source
  > code of Apple II DOS for non-commercial use.


Emulation and production of expansions & 3rd party replacement parts of older home computers often are in a legal grey area regarding permission to use, distribute, or modify the original IP.

Permission like this is very clarifying and welcome, and has nothing to do with what you run on your Debian box.


Thanks for the reply (I note lots of non-explained downvotes, which are always frustrating in response to an earnest question).

Debian reference was perhaps not useful -- more a comparison for vintage of code in use.

I appreciate that it's a grey area, and I grew up coding 6502 & 6510 assembly on C64, hence the interest in reading through the pdf's provided.

It's more the 'non-commercial usage is okay' caveat for the release. I genuinely don't know if there's a possibility of commercial use, or, beyond that question, why the restriction would be placed (it seems extremely unlikely it's for financial reasons).




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: