Sdltrs

broken image


In 1965 a professor at MIT, Joseph Weizenbaum, introduced a computerized conversation simulator he called ELIZA. The most famous ELIZA transcript was published soon after in an article Weizenbaum wrote for the January, 1966, volume of Communications of the ACM. It is a record of a conversation between the program and a young woman; the program's responses in the text below are in all caps.

  1. Sdltrs Git
  2. Trs 80 Model 4 Emulator
  3. Trs 80 Emulator Online
  4. Sdltrs Macos

Men are all alike.
IN WHAT WAY
They're always bugging us about something or other.
CAN YOU THINK OF A SPECIFIC EXAMPLE
Well, my boyfriend made me come here.
YOU BOYFRIEND MADE YOU COME HERE
He says I'm depressed much of the time.
I AM SORRY TO HEAR YOU ARE DEPRESSED
It's true. I am unhappy.
DO YOU THINK COMING HERE WILL HELP YOU NOT TO BE UNHAPPY
I need some help, that much seems certain.
WHAT WOULD IT MEAN TO YOU IF YOU GOT SOME HELP
Perhaps I could learn to get along with my mother.
TELL ME MORE ABOUT YOUR FAMILY
My mother takes care of me.
WHO ELSE IN YOU FAMILY TAKES CARE OF YOU
My Father.
YOUR FATHER
You are like my father in some ways.
WHAT RESEMBLANCE DO YOU SEE
You are not very aggressive but I think you don't want me to notice that.
WHAT MAKES YOU THINK I AM NOT VERY AGGRESSIVE
You don't argue with me.
WHY DO YOU THINK I DON'T ARGUE WITH YOU
You are afraid of me.
DOES IT PLEASE YOU TO BELIEVE I AM AFRAID OF YOU
My father is afraid of everybody.
WHAT ELSE COMES TO MIND WHEN YOU THINK OF YOUR FATHER
Bullies.
DOES THAT HAVE ANYTHING TO DO WITH THE FACT THAT YOUR BOYFRIEND MADE YOU COME HERE

I've therefore been using a much more obscure emulator, SDLTRS, which not only runs properly on my Windows machine but also has versions for the Mac and for Linux. The MESS project also includes an emulated TRS-80 that works very well, but getting that up and running will take a bit more effort. It's running SDLTRS emulator which emulates the Model I,III,IV (and IVP?). IF YOU WANT A HASSLE-FREE, FULLY LOADED & FUNCTIONAL RETRO COMPUTER. And yes, the original. PLUG AND PLAY ALL THE WAY.

Sdltrs Git

It is often assumed that 'Eliza' is simply the name of the psychotherapist with which the human 'patient' converses, but this is not in fact the case. ELIZA is actually the name of a generalized conversation system of Weizenbaum's devising, being a reference to a working-class character in George Bernard Shaw's play Pygmalion who learns to speak in an upper-class diction in spite of her origins. The metaphor, then, is that the computer has traded in the inflexible diction of a programming language for everyday natural language. Different 'scripts' could be plugged into ELIZA to represent different characters. The first of these to be developed by Weizenbaum, as well as the one that generated the transcript above and the one that everyone remembers today, was called simply 'Doctor.' In the film Rebel at Work Weizenbaum describes the process that led him to this rather brilliant character choice:

'And then all of a sudden it came to me: the psychiatrist. The psychiatrist asks questions in response to what the patient says. It may be partially or totally irrelevant, but the patient will interpret his words in terms of his own frame of mind. The patient assumes that the psychiatrist knows something, that he understands, that there is some sense to his words. ‘I don't know what it is yet, but it's not nonsense.' And that's how it started — then came ELIZA.

‘Well,' says the psychiatrist, ‘perhaps… what does this remind you of?'

‘Hmm, very clever!' thinks the patient. ‘This is a psychiatrist who really knows what I feel. I'm going to continue working with him.''

Trs 80 Model 4 Emulator

As Weizenbaum was careful to describe in his article, in no sense does ELIZA actually understand anything its interlocutor enters. It is simply an elaborate text-generation engine, which searches for patterns in the entered text which can serve as hooks to be manipulated and recombined into its responses. The genius of the 'Doctor' script is that this is also essentially what a psychotherapist often does during a session, at least from the perspective of the layman. Weizenbaum did prepare at least a few other ELIZA scripts, such as (keeping with the mental health theme) one for a paranoid schizophrenic, but these apparently did not have quite the same magic, and aren't much remembered today.UPDATE: Actually, as Nick points out in the comments below, we have no evidence that Weizenbaum developed any scripts other than 'Doctor.'

Even if we confine ourselves to 'Doctor,' the famous script I included above is something of a best-case scenario. Weizenbaum, usually quite sober about these things, was stretching the truth considerably when he called it a 'typical conversation' in his article. There inevitably comes a point in any ELIZA session that continues for any length of time when the program says something that clearly reveals it to be the elaborate parlor trick that it really is. Such breakdowns are at least as common as the several surprisingly apropos responses in the transcript above.

Weizenbaum wrote ELIZA in Lisp, a somewhat esoteric programming language developed at MIT for artificial intelligence and natural language processing applications.UPDATE: Make that MAD-SLIP, which originated at the University of Michigan. See Nick's comment below for more details. However, his detailed ACM article served the same purpose as did Don Woods's meticulously commented Adventure source code of ten years later, making the porting of ELIZA to other platforms and languages a relatively straightforward task. In the process, Weizenbaum's original concept of a generalized conversation engine was forgotten, and ELIZA the system became Eliza the female psychotherapist. Creative Computing published a version in BASIC by Jeff Shrager and Steve North in its July/August, 1977, issue. In North's words, 'Although the program is an inferior imitation of the original, it does work.' Its limitations in comparison with Weizenbaum's original derive from being written in BASIC and from the necessity of running in just 16 K of RAM. It's nevertheless impressive in its way for what it is, and would serve as a springboard for countless sequels and derivations over the next decade. It seemed no one could own a microcomputer in the 1970s or 1980s without having some sort of Eliza variant somewhere in their software collection.

If you'd like to try out this version of Eliza on a virtual TRS-80, you can do so using the SDLTRS emulator and this state file.

1. Make sure the Level 2 ROM file and the NewDOS boot disk are in the emulator's root directory, and that the state file is in some known location.
2. Start the emulator.
3. Turn your caps-lock on.
4. Press ALT-L to load a state.
5. Navigate to the state file and select it.

You'll find yourself at a BASIC READY prompt, from which you can LIST the program, edit it, and of course RUN it. (Yes, it is very, very slow; such is life when doing lots of string processing in BASIC on a 1.78 MHz machine.) Type 'SHUT' at any prompt to quit the program — and remember, you must have your caps lock on for it to 'understand' you.

Finally, for those who know how to deal with such things, I've also made available the tokenized TRS-80 BASIC file of Eliza.

So, having talked about what ELIZA is we can soon get to the more interesting questions of how it works and what it means — and why I felt compelled to backtrack this way in the first place.

Postscript (June 17, 2011):

I've grown disenchanted with the SDLTRS emulator, and decided to use the one included with the MESS project from now on. Here's a state file for use with that emulator. See my recently revised post on emulating the TRS-80 for more details on how to get a virtual TRS-80 working under MESS.

Model I Level II BASIC advertisement from the January 1979 of BYTE. The price for a 16K Level II Model I dropped to $849.00 in a matter of months.

When the TRS-80 Model I was introduced on August 3, 1977, it came with Level I BASIC, a 4K BASIC interpreter, in ROM. Level I BASIC was created by Steve Leininger, the designer of the TRS-80, who based it on the public domain 'Palo Alto Tiny BASIC' that Dr. Li-Chen Wang wrote in 1976.

But Radio Shack's plan was always to upgrade to a more advanced Model I BASIC later. The very first TRS-80 brochure said that 'planned expansion includes an extended Radio Shack Level II BASIC.' It was mentioned again in the first issue of the TRS-80 Microcomputer News (then known as the Radio Shack Microcomputer Newsletter) in 1977:

Sdltrs

A Level II BASIC is now being developed. This will be a 12K BASIC with every feature you ever imagined — PEEK and POKE, PRINT USING, transcendental functions, advanced string handling, etc. It should be available on ROM soon.

Extended BASIC

Level II BASIC was written by Microsoft, a company which at the time was only two years old. Microsoft (originally Micro-Soft) got its start writing a 4K BASIC1 for the Altair 8800 in 1975. This original Altair BASIC was written by Bill Gates, Paul Allen, and Monte Davidoff. Microsoft soon expanded Altair BASIC into an 8K version, and then an Extended BASIC.

Level II BASIC for the Model I was based on the same code as Extended BASIC and was remarkably similar. In a 1981 interview with 80-U.S. Journal, Bill Gates described the design of Level II BASIC:

It's a hybrid, in between Extended and 8K. For example, there are no user defined functions or short error messages; two features typically in Extended. But there are PRINT USING and double precision variables, which aren't found in 8K BASIC. The additional data types were one of the key things we wanted to get. So we took that as given and pared it down to cram it into the 12K.

He also said that Microsoft's work on Level II BASIC took 'about four weeks from start to finish.'

Room

A Level II BASIC is now being developed. This will be a 12K BASIC with every feature you ever imagined — PEEK and POKE, PRINT USING, transcendental functions, advanced string handling, etc. It should be available on ROM soon.

Extended BASIC

Level II BASIC was written by Microsoft, a company which at the time was only two years old. Microsoft (originally Micro-Soft) got its start writing a 4K BASIC1 for the Altair 8800 in 1975. This original Altair BASIC was written by Bill Gates, Paul Allen, and Monte Davidoff. Microsoft soon expanded Altair BASIC into an 8K version, and then an Extended BASIC.

Level II BASIC for the Model I was based on the same code as Extended BASIC and was remarkably similar. In a 1981 interview with 80-U.S. Journal, Bill Gates described the design of Level II BASIC:

It's a hybrid, in between Extended and 8K. For example, there are no user defined functions or short error messages; two features typically in Extended. But there are PRINT USING and double precision variables, which aren't found in 8K BASIC. The additional data types were one of the key things we wanted to get. So we took that as given and pared it down to cram it into the 12K.

He also said that Microsoft's work on Level II BASIC took 'about four weeks from start to finish.'

Features

Level II BASIC retained most Extended BASIC features, such as PRINT USING, double-precision and integer variables2, and IFTHENELSE. Some other features, such as user defined functions, long error messages, and INSTR, were removed but reappeared later in TRSDOS Disk BASIC. Only a few commands, such as ERASE, SWAP, and HEX$, disappeared entirely. Level II BASIC also added some commands, such as SET, RESET, POINT, and INKEY$, that were not present in Extended BASIC.

Here's a description from a 1979 Radio Shack catalog:

Level II is an advanced or 'extended' version of [the] BASIC programming language. It offers vastly increased computing power, faster execution time, faster cassette operation (500 baud), and increased numeric accuracy of up to 16 significant digits (intrinsic functions remain at 6-digit accuracy). In addition, you get formatted printing, program editing (with extensive editing commands), error trapping, named files, multi-dimensional arrays, comprehensive string variable handling, automatic line numbering, tracing, keyboard rollover, and many other features which will delight the advanced programmer. Of course, a detailed 140-page manual is included.

Although Radio Shack had planned to release Level II BASIC in late 1977, it wasn't actually available until March 1978. The Level II BASIC (ROM) Kit (catalog number 26-1120) cost $120.003. Installation at a Radio Shack store was required, but the installation was included in the price. The Level II ROM would work with both 4K and 16K Model I systems and also systems with a 48K Expansion Interface. Level II BASIC was required to use a disk drive.

Unfortunately, Level II BASIC also introduced the problem of keybounce. There were four revisions of Model I Level II BASIC. The most significant was the version 1.3 revision, which fixed the keybounce problem.

We set the standard

Microsoft's motto at the time was 'We set the standard' and as one 1979 Microsoft advertisement put it: 'The largest-selling microcomputer systems use software by Microsoft.' For example, the Commodore PET 2001, the Apple II4, and the Radio Shack TRS-80 all (eventually) used Microsoft BASIC in ROM. Microsoft BASIC was one of the few standards in the early microcomputer industry and most of the implementations were quite similar. As the introduction to the book Microsoft BASIC Decoded and Other Mysteries (which contained an analysis and disassembly of the Model I ROM) pointed out, 'Although you may find that the code is organized differently in your Heath or Sorceror, the routines are, for the most part, identical!'

Disk BASIC

Level II BASIC reserved a number of commands, such as LOAD and OPEN, for future use5. They were implemented by TRSDOS Disk BASIC, which was also written by Microsoft. TRSDOS Disk BASIC was very similar to Altair Disk BASIC and mostly used the same commands, although a few Altair-specific commands, such as MOUNT and UNMOUNT, were not implemented. Not all of the added commands were disk-related. Some of the most useful commands, such as INSTR and expanded MID$, had nothing to do with disk.

Other TRS-80 operating systems, such as MULTIDOS, DOSPLUS, and LDOS, included their own Disk BASIC interpreters not derived from TRSDOS Disk BASIC. Although mostly compatible, these interpreters added additional features and usually used less memory.

Level III BASIC

Microsoft wrote one other BASIC version for the Model I called Level III BASIC. It was originally sold by GRT Corporation and had the distinction of being the first Microsoft program sold directly to consumers. Level III BASIC was available for cassette and Exatron Stringy Floppy users only, but it served much the same purpose as TRSDOS Disk BASIC.

Model III BASIC

Trs 80 Emulator Online

Although some Model III computers were sold with Level I BASIC, the vast majority were sold with Level II BASIC. Radio Shack created their Model III implementation of Level II BASIC using the same code as the Model I version6. It could run almost all Model I Level II programs. For some reason, Radio Shack referred to it in catalogs as 'Model III BASIC' rather than 'Level II BASIC,' although I don't know anyone else who used that name.

Model III BASIC was 14K long, 2K longer than the Model I Level II BASIC. The extra 2K was used for a lowercase driver, time and date commands, and several other features.

Model 4 BASIC

Sdltrs Macos

The TRS-80 Model 4 was completely Model III compatible, but also could run its own more advanced version of TRSDOS. The BASIC included with Model 4 TRSDOS was derived from MBASIC, Microsoft's implementation of BASIC for CP/M. Although both were written by Microsoft, MBASIC differed quite a bit from Altair Extended BASIC. Converting a program from Level II BASIC to Model 4 BASIC was usually not a trivial undertaking.

  1. As a bit of trivia, 4K Altair BASIC was one of the very few Intel 8080 programs that wouldn't work on the Zilog Z80. ↩︎

  2. Some sources state that Level I BASIC had no floating point support, but actually the opposite was true; all it supported was floating point numbers (the equivalent of single-precision in Level II). This is probably due to confusion with Apple II Integer BASIC, which also preceded a Microsoft BASIC (Applesoft). ↩︎

  3. The Level II Kit also contained a 'Level II Blackjack/Backgammon tape.' ↩︎

  4. The Apple version of Microsoft BASIC was named Applesoft. The first version of Applesoft BASIC (Applesoft I) was released on cassette in January 1978. The better remembered Applesoft II, released in May 1978, was eventually available on cassette, disk, and in ROM. ↩︎

  5. Invoking one of these commands generated a ?L3 ERROR. The L3 was an abbreviation for Level III BASIC. According to Bill Gates, TRSDOS Disk BASIC was originally going to be called Level III BASIC but the name was changed after Level II BASIC was completed. Microsoft later reused the name for their own product. ↩︎

  6. Microsoft had no part in the conversion although, according to John Roach, they received 'additional compensation' for its use in the Model III. Bill Gates said that Microsoft received 'an on-going yearly fee' for Model III BASIC, further stating that it was 'strictly bounded.' ↩︎

Related Posts:

Categories: Software




broken image