BASIC
The Altair 8800 is widely accepted as the first Personal Computer, it was released in December 1974 and featured in Popular Electronics magazine in January 1975. I have some recollection of reading about it at the time and wanting to buy one - although it would have been much too expensive for me and impractical to obtain one from America.
A couple of Harvard students, Bill Gates and Paul Allen, wrote a version of the BASIC language for the Altair and it became the first product of the company they formed called Microsoft.
To celebrate 50 years of Microsoft Bill Gates released the original BASIC source code
When I first used IBM PCs they contained no hard drive, just floppy disks. If you forgot to put a floppy disk in the computer it would start running cassette basic.
Building MSBASIC for BEN2
The 6502 BASIC code is available on Github, and most of the files are 17 years old, reflecting the time when code was released to the public domain.
Rather unusually for Ben, he uses a trial and error method to build BASIC. There are three main changes, the variables defined, character input and output, and memory configuration. The Commodore Basic variables were used initally and adjusted to fit Ben's 6502. We just have to provide our own I/O routines which are readily available and specify the details of our memory in eater.cfg.
Ben programs a ROM chip each time he modifies a program so he creates a 32KB image. My 6502 system usually has software loaded via the serial port so I dont have to remove/insert chips each time I make a change, since I find it incredibly tedious.
Unfortunately the BASIC program is about 9kB in size and much bigger than my usual programs. My serial download program fell over so I had to revert to Bens ROM burning approach.
This required me to learn a little more about the assembler and linker utilities CA65 and LD65 so that I could choose where to locate BASIC in ROM. Ben stores MSBASIC at the start of ROM address $8000 and the WOZMON monitor at $FE00 at the end of ROM. I modified my system so that WOZMON could be stored at the end of ROM and BASIC is stored at $C000 in the middle. This means I can still use my monitor MON5 at $A001 or the backup MON4 at $8001.
First startup of BASIC running on BEN2 felt awesome, suddenly we have a computer that is easy to write programs for. Ben mentioned that there is a little "Easter egg" in the program. When prompted for memory size, if you type "A", the names of the programmers "Weiland and Gates" are displayed.
So my last two projects have used source code written by Steve Wozniak, founder of Apple, and Bill Gates, founder of Microsoft.
As always there are some enhancements we need to make but this is definitely a leap forward.
No comments:
Post a Comment