Monday, May 10, 2010

Apple-1 BASIC Firmware Card... it works.

See the video of the card up and running Hello World!



I used a 512k EPROM because it's all I had on hand. BASIC is only 4k so you can use a much smaller chip if you'd like. (I have some 8k chips ordered...) I programmed the AT27C040 EPROM using a "Top2004" programmer.
Note that on the Apple-1, I have jumpered "S" to "E" (CSE) so that when E000R is entered, BASIC will run.

I finally sat down and started to debug my Apple-1 BASIC firmware card. I had never played with the Pom1 emulator, so I downloaded the C source code and after about an hour I had it running in xCode. The image below, shows the emulator running the same BASIC ROM file that I had burned into my EPROM chip. You can see, it does not show the ">" prompt as it should.


This is the apple1basic.bin file, which I downloaded many months ago from www.pagetable.com. This is the same output I was seeing with my BASIC firmware card. (At this point, you must do a reset, as BASIC fails to load).
I then loaded the "basic.rom" file that is included with Pom1 and it loaded BASIC without any problem. Clearly something wasn't right here... so I did a cmp/diff on the two files, and as it turns out, 2 bytes are incorrect in the apple1basic.bin file downloaded from www.pagetable.com.
see below, where hilited - (decimal 976 and hex 03D0):


The above 2 images show the hex and decimal locations of the 2 incorrect bytes found in apple1basic.bin



In addition to the ROM file differences, I found I had my wires crossed.... the above image shows the incorrect wiring on address lines A8, A9 and A11.
After moving these address lines to their correct locations, and burning the EPROM with the new working BASIC ROM file, you can see that I was able to load and run the BASIC "Hello World!" program.

UPDATE: September 22, 2010 - Here is a link to the Basic Disassembly
Download the files, and view with a text editor.

No comments:

Post a Comment