söndag 3 maj 2009

The History of Microsoft Basic and The Easter Eggs

Not long ago I found an amusing and interesting webpage about the history of Microsofts early 8-bit Basic versions and the hidden "easter eggs".
The MS Basic is considered to be Microsoft's first commercial and successful product as well as the foundation for what to come to be....

The webpage also contains a timeline (or "pedegree") for 8-bit MS Basic. UK101 is not mentioned but should be identical to the OSI 600 version and so based on MS Basic 1.0, 7 digit and 32 bit floating point library.
The only known easter egg in the UK101 version of MS Basic is the message "This is the Compukit" displayed after pressing A at startup and after "Memory size?".
In some other Basic portings the names of the developers are shown (Gates, Weiland, et al).
The purpose of these easter eggs was mainly to detect piracy-copying, a problem even today! According to the story, Bill Gates himself once found a non-licensed copy using a easter egg command on a computer at a store. "I'll sue you!!!"

For fun I tried the known easter egg commands WAIT6502,1 and CLS9, but to no avail.....as expected.

A couple of questions arises:
Was UK101 Basic licensed by MS directly or through OSI?
If not, did Practical Electronics/Compshop discover a legal loophole?
I know there was a legal battle between OSI and PE, but what about the Basic ROMS?
Perhaps we'll never know or perhaps not even an issue....

See: http://www.pagetable.com/?p=43

onsdag 18 februari 2009

Chip Archeology!

Taking a look at the UK101 board and the various chips (ICs) is very interesting.
A lot of different chip makers, some still existing, some diverted to other areas and the rest aquired or out of business since long...
The dominant brand is Synertek. The MOS 6502 uP was 2nd sourced by Synertek. All the ROMS are Synertek as well, also 4K of memory.
Here is the list of the original chip manufacturers in some kind of descending order:
-Synertek (the 6502, all ROMS, 2114's memory, 74x TTL logic)
-National Semiconductor (74x's)
-Texas (74x, 2716 EPROM)
-Semi (2114's)
-Signetics (74x)
-Raytheon (74x)
-NEC (2114)
-Motorola (74x)
-Thomson (6850 ACIA)
-RCA (CA3130 opamp)
+ some odd ones, the uA8T28's (who? Fairchild? Texas?)
(Not installed: Intel 2716, the "The New Monitor")

Even more interesting are the date-stamps.
Most chips are dated late 1979, for example the Synertek 6502 dated at 1979 week 41.
Some others are from early -80.
The extra 4 K memory chips are dated 8049 which surprised me as I thought I did this upgrade in first half of 1980 and not in -81?.
The oldest chips on the board are the Texas 74LS163's from 1973 w39! 36 years old, still doing a simple but important job!

The MOS 6502 could actually be considered as an early "pipelined RISC" processor and was clearly faster than the popular Motorola 6800, Zilog Z80 and Intel 8080 uP's at the time. Even at less clock speed. And this to the price of some 15% of the competition, introduced at 25 USD per chip!
MOS was soon taken over by CBM (Commodore) already around 1976-77 to supply CBM's productlines with 65xx uP's (PET, VIC what-ever).
This takeover was, in my opinion, a sad story as many developers soon one by one left CBM including "the man" and 6502 chief designer himself, Chuck Peddle.
For more about the history of 6502 and other chipmakers mentioned above, please refer to Wikipedia and company sources on the web. There's a lot...


söndag 25 januari 2009

Getting the pieces togheter...

- Saving files to WAV and to MD and MP3 players.
My "boom-box" doesn't have any recording input. This is the only existing cassette-player at home. The rest; such as Walkmans, my very first Philips recorder from 1970(?) and even the HiFi stereo tapedeck are gone for ever.
So, what about recording files to todays digitatised formats such as MP3, WAV and MD?
Read somewhere that MP3 wouldn't work and I dropped that alternative immediately.
Archieving all the audiofiles to WAV was easy, a freeware recorder and a cable between PC and tape. Recording was done in 22 kHz, 8 bit mono to be compliant with the KCS08 encoder/decoder program for the ancient Kansas City and CUTS formats, if any decoding should be needed. For fun, I tested the KCS decoding and also encoding and it worked. Great utility!
--MD: (Sony ATRAC) works very well, both in loading and saving. No dropouts at 600 baud were discovered.
The disadvantages are the proprietory audio-only format, it's is not a file directly recognized by Windows (needs decoding), needs specific media and that my old player (MZR30 from 1998) is somewhat "clumpsy".
-- WAV: (recorded on a iAudio U2 MP3 stick) also works well, although more sensitive when it comes to recording levels, at least at 600 baud. The stick is of course more convinient and more self-contained. Also the possibilities of file management in Windows for archieving etc is better.
Will try to increase the recording level on the UK101 by changing the resistor-network at the output.
















- The PIA and future troubleshooting
I built the PIA (parallell interface adapter, based on 6821) in the early 80's and it worked well.
At least it could drive LED's, indicating output and proper function. I don't remember testing input on the other hand.
I bought two extra 8T28 IC's from Philips Sweden (a long story itself...) as buffers and but they were'nt needed in this case. Instead I jumpered the sockets (U6, U7). For trivia, the 8T28 were stolen, along with a lot of other electronic stuff, in a inbreak in my shed 1996.

The interfacing was rather easy. Instead of building an external interface with addressing logic, I used one spare output of IC17 address decoder (also controlling the ACIA) plus did some trace-cutting on the board (for connections to PIA chipselect and +5V)

One project for the PIA was a EPROM programmer and I did some programming for it, but time and interest lacked at the end.

During the restoration work I found that the PIA "hangs" the UK101, in other words stops executing. Will do some troubleshooting on this when some sparetime shows up! Could be a short or perhaps a bad 6821.
Scoping the signals, at the socket and at the 6821 shows no "ratty" data or signals.
Well, the good news is that 6821 is still available as new as well as surplus, if needed.

- New version of the File Manager planned!...
The tool for further development in assembler is the below freeware that has proved to be very good!

torsdag 15 januari 2009

Up and Running!

- After solving the tapeload issue I began to load the old cassette tapes from the 80's.
Talk about nostalgica!...
Self-made games such as Quest (inspiration from Byte magazine), Star Wars, Dogfight, TicTacToe, the Knight Chess Problem, Lunar Lander and Nimble (user vs computer, the latter hard to beat).
And the "File Manager", in pure machinecode, resident in the safe area of RAM.
This routine searched for fileheaders on tape, then loading. Slow, but it worked!
I was very proud achieving this I remember...No assembler used, just pure hex....!
Later, a lot of half-done projects were also discovered on some tapes, eg a wordprocessor as well as other games.





























The Big Baud mystery!

This was really driving me nuts !!
Early in the restoration work, the fileloading from cassette didn't work and I suspected a bitrate/baud mismatch. Only garbage showed up on the screen and the lack of documentation made this difficult in the beginning.
1. The wires:
When I took the very first look at the UK101, three loose wires were still soldered to the board; to the lifted pin 9 on IC63, pin 9 of the IC63 socket and pin 12 on IC60. I remembered a switch for Tape/Printer selection, now missing.
2. The printer:
Back in -84 I connected a Digital DECwriterIV (LA34) to the RS232 port of the UK101. Worked very well! But in what baudrate? Looking at LA34 spec's on the web didn't give a clear answer to this; LA34 came in two versions, 300 fixed version and a version with selection up to 9600.
3. The cassette labels:
Even more confusing was that most cassettetapes were labeled 300, 600 and ... nada.
4. The troubleshooting:
Looking deeper in some schematics I found on the web I began to understand the cassette interface clocking scheme. The original standard bitrate is 300 baud, clocked from C3 on IC59. A 600 baud mod would use C2 on the same IC, but with an altered pitch not compliant with KCS standard. Picking the clock from C7 on IC60 (pin 12) at 7,84 kHz directly to the ACIA would give a bitrate of 490 baud (7840/16=490). Very odd! Why did I do this? Surely for some reason, probably a subpar taperecorder suffering from dropouts at 600 baud.
Nevertheless, even at 490 baud it didn't work!
Started to scope the signals, both clocks and bitstreams, and it seemed ok (as example: below scope shot @7,84 kHz), EXCEPT for the IC69 that had some strange spikes at one pin!
Near of giving up I did a very last move: Earlier I had replaced the IC69 (74LS123) for a HC version, this due to some suspected bad connection/oxidation and the only type quickly available from my local supplier (http://www.elfa.se/).
Could it be?.....
Yes! After reverting back to the old LS chip the tapeloading suddenly sprung to life!!
Lesson learned: HC is not 100% compatible with LS!
Later I replaced the socket instead, rather than the IC itself.

The defunct CEGMON story
















The original monitor-chip MONUK01 (yesterdays "BIOS" to some extent) was standard in the beginning and included in the kit that I assembled.
Soon I replaced it with the "New Monitor" that had some extra features, but also a lot of changes such as vectors and.... the flashing prompt that blurred the screen! Yes, I know it could be switched off by a POKE.

Later, when then I did the extended video mod, a new monitor was needed to support 32 lines.
I bought the CEGMON monitor (extended), a full featured monitor with a lot of good functionality, good documentation and...support for 32 lines! I liked it a lot!
Unforturnately I zapped CEGMON EPROM in -84 when I did a printout of the EPROM content and swapped it with power ON! No supplier/agents were still in business in that time and I had no means of reprogramming a EPROM myself. This was the end!!...or..??
The disassembled printout w
ould later prove to be very important!
The CEGMON issue was resolved in Oct. 2008 by some help from the community.
From the printed listing I painstakingly started to type every byte into a freeware hexeditor (Neo), then sanity-checked the code in a freeware 6502 assembler (6502sim). Good tools by the way...
A helpful friend, found in a electronic forum after crying for HELP!, then programmed a 2716 EPROM for free. The 2716 and even the postage were w/o cost. Great! Thanks!

As you can see from the below picture, the UK101 booted up nicely with the new reborn CEGMON
 monitor.















Yes, it works! In full 32x48 !

Mod's and add-ons

Some pictures of early modifications and add-ons:
- 8K memory (adding 4 k, 8 x 2114's)
- Extended video (32x48 characters, original was 16x48. Adding 1 k memory, some wiring and new decoding logic)
- The RUN-led (shows if the uP is executing or if its hangs, just like VAXes of the 80's! Yepp, I'm an old DEC employee....)
- The PIA adapter (parallell interface adapter, 6821. Connected to J1 directly, mods to IC17)

Other mods were:
- 600 baud cassette-speed (later retrograded to 490), switchable for printing
- RS232 interface (adding some components)
- SCART cable (the most recent mod, interfacing to TV-sets of today!)

Future mods would be:
- The uP running at 2 MHz clock (a Go/Nogo test...we'll see...)
- Getting rid of dark lines during scrolling (procedure exist on web)








Compukit UK101 Revisited...
















I'm not really sure how it came back to me one day in the early fall of 2008!
Maybe after talking to my teenage kids about the good old days of computing and the fact that "Dad"(me that is) had built and used one of the first so-called personal computers as well as one of Microsoft's first commercial products, the MS Basic. Maybe the first MS product what so ever!

The last time I used it must have been around -84 and I did know it was tucked in some box somewhere in the attic since the last move in -94. A attic often damp and cold....
Should it work?
Well, it took not long to find it! Fortunately it was wrapped in a plastic bag so the prospects for survival was rather good. I also found a binder with a lot of documentation, listings and notes, but not the manual, schematics nor the Basic manual.
In the bag I also found the PIA adapter (see further above) and also two old monitor ROMS, the orginal MONUK01 and "The New Monitor" that was standard in later releases.
On the other hand some parts were missing: the UHF modulator, a "baudrate" switch, the CEGMON monitor EPROM and the transformer.
The transformer was eventually found in a junkbox, the modulator could be substituted for a SCART connection but the crucial part was the CEGMON monitor.
The UK101 was modified for 32 lines and only this special version of CEGMON supported this.
And now memories came back; I had zapped the CEGMON in -84 when removing or inserting it with power on....!! Damn!
Anyway, to get the UK101 up and running, MONUK01 would do it with a half screen display (16x48).
Connected all the parts and powered on, for the first time since 1984! ........
Yippie! Got the D/C/W/M prompt and it "booted up" instantly!
Truly amazing after all these years!
Some flickering on the screen was there and sometimes only half the memory at start, but this was solved by pressing some chips now and then. These problems was to be expected due to the oxidation of sockets and IC's.
People may ask one question at this point:
Why try to refurb this vintage outdated UK101 computer when you could just start up a WinOSI/UK101 emulator in a PC and play around? Why?....
The smell of heated good ol' TTL logics? The feeling of the "tactile" keyboard? 8 KB of tight memory to play with instead of GB's? All the following small demanding problems you would encounter? All the programs you did 30 years ago, saved on cheap audio-cassettes and had forgot?....
Well, I DON'T KNOW! Perhaps everything mentioned and....of course...NOSTALGICA!

Background: The early years of home computing!

Back in 1980 I bought and assembled my first personal home computer, the Compukit UK101. This was during the era of the "microcomputer revolution" started in the mid 70's when small companies, mainly in the US, began to develop and market computer systems and software for hobbyists, homeusers and small businesses, all based on microprocessors. This was the beginning of homecomputing boom and later on, the PC! You probably heard this story before.....!
A lot of these companies were successful (MITS, IMSAI, PET et al, and also the swedish TV-set maker Luxor with the ABC80, that I used the last year in highschool) and some firms are still in business, such as Microsoft and Apple! :-)
The Swedish tech magazine "Radio & Television" published in issue 1/1980 a review of the Ohio Scientific Superboard II that caught my first interest. Here you had an inexpensive, simple and yet "powerful" computer available as a kit or assembled, aimed for hobbyists!
Based around the then very popular 6502 uP (MOS Technology) and Microsoft's 8K BASIC-in-ROM, the Superboard was equipped with full ASCII keyboard, 300 baud cassette interface (Kansas City), a RS232 port, 4K of RAM and a video output for a TV-monitor.
Some minor quirks existed, such as a 60Hz video refresh rate which was not suitable within Europe, only 24 characters width and no inboard PSU.
Price was about 2900 SEK fully assembled (some 240 GBP). Less than any other computer on the market but still a large amount for a student in 1980, about to enter mandatory military service the same year!
My memory is lacking but I believe it was a friend's sisters boyfriend (working in UK or was it from reading in Practical Electronics?) that discovered a computerkit in the UK based on the Superboard II.
Anyway, my friend eventually bought the UK101 from the swedish distributor and I was hooked!!
Soon, after saving any penny (öre) I could get hold of and persuading my father to buy a UK101 on the firm (some discount), I finally got my own UK101!
After a couple of evenings and nights, soldering components and inserting IC's, the UK101 soon was ready for work! Power on.... Nothing happened!
After doing "bus-shortening", removing IC's one-by-one, I soon discovered a classic mishap. A bent pin under a IC, very hard to detect by eye.
Fixed that and the famous prompt showed up on the screen:
D/C/W/M?