4 ms·
I've written an Intel 8080 emulator that was portable between Dec10/VAX/IBM VM CMS. That was easy - the 8080 can be done quite simply with a 256 value switch -
by zabzonk 2y ago
I've written an Intel 8080 emulator that was portable between Dec10/VAX/IBM VM CMS. That was easy - the 8080 can be done quite simply with a 256 value switch - I did mine in FORTRAN77.
Writing a BASIC interpreter, with floating point, is much harder. Gates, Allen and other collaborators BASIC was pretty damned good.
- phkahler 2y agoI still have a cassette tape with Microsoft Basic for the Interact computer. It's got an 8080.
- thesuitonym 2y agoYou should upload the audio to the Internet Archive!
- thijson 2y agoI remember my old Tandy Color Computer booting up and referencing Microsoft BASIC: https://tinyurl.com/2jttvjzk https://tinyurl.com/2jttvjzk The computer came with some pretty good books with example BASIC programs to type in.
- vile_wretch 2y agoI have a MS Extended Basic cassette for the Sol-20, also 8080 based.
- musicale 2y agoI agree - it's a useful BASIC that can do math and fits in 4 or 8 kilobytes of memory. And Bill Gates complaining about pirating $150 Altair BASIC inspired the creation of Tiny BASIC, as well as the coining of "copyleft".
- TMWNN 2y ago>Writing a BASIC interpreter, with floating point, is much harder. Gates, Allen and other collaborators BASIC was pretty damned good. The floating point routines are Monte Davidoff's work. But yes, Gates and Allen writing Altair BASIC on the Harvard PDP-10 without ever actually seeing a real Altair, then having it work on the first try after laboriously entering it with toggle switches at MITS in Albuquerque, was a remarkable achievement.
- zabzonk 2y agoAllen had to write the loader in machine code, which was toggled in on the Altair console. The BASIC interpreter itself was loaded from paper tape via the loader and a tape reader. The first BASIC program Allen ran on the Altair was apparently "2 + 2", which worked - i.e. it printed "4" I'd like to have such confidence in my own code, particularly the I/O, which must have been tricky to emulate on the Dec10.
- WalterBright 2y ago> which must have been tricky to emulate on the Dec10 I don't see why it would be tricky. I don't know how Allen's 8080 emulator on the PDP-10 worked, but it seems straightforward to emulate 8080 I/O.
- zabzonk 2y agoWell, I found it a bit hard on my Dec10-based emulator. I never got the memory-mapped stuff to work properly - I just mocked up some of the I/O instructions. But it was actually a spare-time project, intended to let my students do stuff like sorting, searching in strings, so I didn't feel too guilty. It had an assembler, debugger and other stuff. And it was portable - completely standard FORTRAN77!
- zabzonk 2y agoAnd I was just thinking - wouldn't it be cool to write a Dec10 emulator on a modern CPU? Actually, one of my programmer colleagues did try to buy our Dec10 when it was decommissioned, with all peripherals, and install it in his garage. Power supply and wife were major obstacles.
- WalterBright 2y agoWhat Allen did was write an 8080 emulator that ran on the -10. The 8080 is a simple CPU, so writing an emulator for it isn't hard. https://pastraiser.com/cpu/i8080/i8080_opcodes.html https://pastraiser.com/cpu/i8080/i8080_opcodes.html Then, their BASIC was debugged by running it on the emulator. The genius was not the difficulty of doing that, it wasn't hard. The genius was the idea of writing an 8080 emulator. Wozniak, in comparison, wrote Apple code all by hand in assembler and then hand-assembled it to binary, a very tedious and error-prone method. In the same time period, I worked at Aph, and we were developing code that ran on the 6800 and other microprocessors. We used full-fledged macro assemblers running on the PDP-11 to assemble the code into binary, and then download binary into an EPROM which was then inserted into the computer and run. Having a professional macro assembler and text editors on the -11 was an enormous productivity boost, with far fewer errors. (Dan O'Dowd wrote those assemblers.) (I'm doing something similar with my efforts to write an AArch64 code generator. First I wrote a disassembler for it, testing it by generating AArch64 code via gcc, disassembling that with objdump and then comparing the results with my disassmbler. This helps enormously in verifying that the correct binary is being generated. Since there are thousands of instructions in the AArch64, this is a much scaled up version of the 8080.)
- teleforce 2y agoFun facts, according to Jobs for some unknown reasons Wozniak refused to add floating point support to Apple Basic thus they had to license BASIC with floating point numbers from Microsoft [1]. [1] Bill & Steve (Jobs!) reminisce about floating point BASIC: https://devblogs.microsoft.com/vbteam/bill-steve-jobs-reminisce-about-floating-point-basic/ https://devblogs.microsoft.com/vbteam/bill-steve-jobs-remini...
- zozbot234 2y agoFloating point math was a key feature on these early machines, since it opened up the "glorified desk calculator" use case. This was one use for them (along with gaming and use as a remote terminal) that did not require convenient data storage, which would've been a real challenge before disk drives became a standard. And the float implementation included in BASIC was the most common back in the day. (There are even some subtle differences between it and the modern IEEE variety that we'd be familiar with today.)
- WalterBright 2y agoWriting a floating point emulator (I've done it) is not too hard. First, write it in a high level language, and debug the algorithm. Then hand-assembling it is not hard. What is hard is skipping the high level language step, and trying to do it in assembler in one step.
- zabzonk 2y agoI've never understood floating point :-)
- WalterBright 2y agoThe specs for it are indeed hard to read. But the implementation isn't that bad. Things like the sticky bit and the guard bit are actually pretty simple. However, crafting an algorithm that uses IEEE arithmetic and avoids the limitations of IEEE is hard.
- hh2222 2y ago