Shop OBEX P1 Docs P2 Docs Learn Events
MITS Altair BASIC for Propeller anyone ? — Parallax Forums

MITS Altair BASIC for Propeller anyone ?

heaterheater Posts: 3,370
edited 2012-04-11 12:15 in Propeller 1
Surprising myself in a big way I have just managed to get the 8080 emulation for the Propeller to run MITS Altair Basic.

You can now enter, edit and run programs written in one of Microsoft's first basics on your Prop Demo board! See attached screen shot.

This is mostly the same as the CP/M for the Prop package (2.1) but:

1. Altair extended basic v4 is loaded into memory instead of CP/M.
2. Added emulation of the 8080 RST instructions as the BASICS use them even if CP/M does not.
3. Added emulation of the Altair's front panel switch register which is used by BASICS to determine serial port configuration.

This build still includes disk emulation on an sd card but will run with no sd card present.

To run this:

1. Unzip the thing somewhere
2. Make altair_sim.spin the top level file
3. Compile all CTRL-F10
4. Run PropTerminal to talk to it (Included in the zip)
5. Hit return when prompted for "MEMORY SIZE ?"
6. Hit "Y" and return when prompted for "WANT SIN-COS-TAN-ATAN
7. Enter your favourite BASIC program and RUN.

Also included is the earlier 8K and 4K basics which you can try by editing a line in altair_mem.spin, look for "OPTIONS" in the comments there.

I promised myself years ago not to get involved in MS products again but, well, this is another test of the 8080 emulation and at least it fits within the HUB RAM.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
«13

Comments

  • BaggersBaggers Posts: 3,019
    edited 2009-01-14 09:49
    Congrats heater [noparse]:)[/noparse] looks great, will have a play later

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • RossHRossH Posts: 5,512
    edited 2009-01-14 10:06
    Very cool. Thanks.
  • BaggersBaggers Posts: 3,019
    edited 2009-01-14 10:54
    btw heater, i'm impressed to managed to fit a M$ product into HUB-RAM, I bet thats the only M$ product that fits lol [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • heaterheater Posts: 3,370
    edited 2009-01-14 11:02
    baggers said...
    i'm impressed to managed to fit a M$ product into HUB-RAM

    Thing is microsoft started out quite well squeezing BASIC into only 4K RAM. Quite a feat in itself. But then things snowballed exponentially, 8K BASIC then extended BASIC at 16K. Pretty much using everything Moores Law had to offer as soon as possible. Till we come to Vista which seemed to be launched ahead of the transistor count.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-01-14 11:03
    Well done heater. Brings back some memories smile.gif Unfortunately, no time to try at present.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Prop Tools under Development or Completed (Index)
    http://forums.parallax.com/showthread.php?p=753439

    My cruising website http://www.bluemagic.biz
  • BradCBradC Posts: 2,601
    edited 2009-01-14 11:21
    heater said...
    Thing is microsoft started out quite well squeezing BASIC into only 4K RAM. Quite a feat in itself.

    Easy to do when you "appropriate" someone else's code from a printout in a dumpster.

    Your achievement however, is something incredibly impressive. Well done indeed! Can't wait to drag out some of my old CPM disks and have a play.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cardinal Fang! Fetch the comfy chair.
  • BaggersBaggers Posts: 3,019
    edited 2009-01-14 11:53
    Yeah, it's systems did expand to stupid proportions, I wonder if there is a FULL complete version of the source for Vista, the install size is massive, so I wonder how big the source is. lol wouldn't fancy getting that printout from a dumpster and typing it in lol.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • heaterheater Posts: 3,370
    edited 2009-01-14 12:12
    @BradC: Do you have any links to this "dumpster" story?

    Because from what I understand MITS basic was orignaly written by:

    Paul Allen - The BASIC interpreter stuff.
    Monde Davidoff - The floating point stuff.
    Bill Gates - Some dinky I/O routines for the Altair.

    The last of which has given everybody grief over the years trying to run it on other hardware or simulators including myself and PropAltair. Still can't get the 4K version to run. Thanks Bill.

    Perhaps we will never know exactly, the source has been "lost". Which is odd considering how much money made out of it.

    P.S. Reminds me of the time in 1976 my friend and I walked into the computer lab at the University of Manchester Institute of Science and Technology (UMIST) one weekend. We were from another Uni. There was nobody around. My friend started fishing around in the trash cans and eventually pulled out a listing with a login sequence including password on it. We were soon into their main frame[noparse]:)[/noparse]

    Also saw my first ever EPROM, on a bench in that lab that day.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.

    Post Edited (heater) : 1/14/2009 12:56:46 PM GMT
  • HumanoidoHumanoido Posts: 5,770
    edited 2009-01-14 12:18
    I suppose you could also fit in Tom Pittman's Tiny BASIC?

    humanoido
  • heaterheater Posts: 3,370
    edited 2009-01-14 12:30
    According to Tom Pittman "I never did an x80 version of my TinyBasic".

    But here www.ittybittycomputers.com/IttyBitty/TinyBasic/ he suggests some one else did. His link for it does not work. Do you have a copy or a link to it and/or info?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • BradCBradC Posts: 2,601
    edited 2009-01-14 12:38
    heater said...
    @BradC: Do you have any links to this "dumpster" story?

    Numerous. Not that I can remotely claim they pretend to be unbiased, but the story has been around a *long, long* time.

    www.freedomunderground.org/view.php?v=3&t=3&aid=14022
    macosx.com/forums/317703-post12.html
    www.dhanapalan.com/blog/2008/06/22/bill-gates-and-the-importance-of-source-code/
    www.dynamicobjects.com/d2r/archives/002646.html
    www.daniweb.com/forums/post23101-3.html
    www.vanwensveen.nl/rants/microsoft/IhateMS_1.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cardinal Fang! Fetch the comfy chair.
  • heaterheater Posts: 3,370
    edited 2009-01-14 13:32
    Ah those stories. Well as much as I loath to stand up for Bill this dumpster diving part does seem to be a bit over the top.

    1. For sure learning to code is greatly aided by reading the code of those who have come before. From a dumpster or not.
    2. Fishing a BASIC interpreter for a PDP10 out of a dumpster and using it as inspiration as to how to write one for an 8080 is not exactly a trivial exercise and far from "appropriating".
    3. The thing about unauthorized use of the university computer, well we all tried to do that at uni. How else could you progress at the time?

    It's interesting to compare the software industry development with that of the steam engine. James Watt is generally credited with being the great inventor there and the firm Boulton and Watt made piles of money out of it. Everyone at the time knew how to make a steam engine, they were all busy trying copying each other whilst at the same time locking ideas up with patents and royalties. Stifling progress as they did so.

    Meanwhile the "true" inventor of the steam engine was a young unknown boy name of Humphrey Potter who devised away to make the engine push up and down repeatedly, continuously by itself rather than rely on an operator (a young boy) opening and closing valves ten times a minute. He of course got no credit or reward, rather he was fired and replaced by his own invention!

    I also consider young Potters invention to be the first use of "feedback" rather than the oft quoted steam regulator of Watt.

    Read about my hero Humphrey Potter here: http://inventors.about.com/od/nstartinventors/a/Newcomen_2.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-01-14 15:03
    @heater,

    Nicely done! I had a feeling you would get this working. [noparse]:)[/noparse]

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Check out: Protoboard Introduction , Propeller Cookbook 1.4 & Software Index
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS
  • potatoheadpotatohead Posts: 10,261
    edited 2009-01-14 16:16
    Excellent!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
    Safety Tip: Life is as good as YOU think it is!
  • heaterheater Posts: 3,370
    edited 2009-01-16 14:27
    Pleased to announce that Microsoft's original 4K BASIC is now working under PropAltair.
    May God forgive me.

    It will also run 8K and Extended BASICS, just edit two lines in altair_mem.spin, look for "OPTIONS".

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-01-16 14:34
    ...this is the beginning of the end.. Micro-Soft products running on a Propller..

    Next thing you know we'll be dealing with SPAM, popup ads..
    Peter Venkman: "Human sacrifice, dogs and cats living together... mass hysteria! "

    Nice Job! Looking forward to playing with this...

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Check out: Protoboard Introduction , Propeller Cookbook 1.4 & Software Index
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card connected? - PropDOS

    Post Edited (Oldbitcollector) : 1/16/2009 3:01:16 PM GMT
  • heaterheater Posts: 3,370
    edited 2009-01-16 14:52
    Don't forget to send ~$200 to:

    William Henry Gates III
    1180 Alvarado SE,
    #114,
    Albuquerque,
    New Mexico,
    87108

    As requested by same in 1976 www.blinkenlights.com/classiccmp/gateswhine.html

    Which, by the way, is demanding money not due to him. These basics contain the string "COPYRIGHT 1976 BY MITS INC."

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • shanghai_foolshanghai_fool Posts: 149
    edited 2009-01-16 15:05
    This is true. I purchased mine from MITS (punched paper tape, I didn't trust cassettes). I don't know if MITS paid Gates or not.
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-01-16 15:29
    You forgot viruses !!!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Prop Tools under Development or Completed (Index)
    http://forums.parallax.com/showthread.php?p=753439

    My cruising website http://www.bluemagic.biz

    Post Edited (Cluso99) : 1/17/2009 3:43:43 PM GMT
  • heaterheater Posts: 3,370
    edited 2009-01-16 15:35
    Well the 8k and extended basics contain the strings "WRITTEN FOR ROYALTIES BY MICRO-SOFT" so I guess your money got to Bill eventually. Which really makes it clear that Bill was asking for money from hobbyists (well anyone) for something which was not his.

    By the way how much exactly was your basic ?

    I miss those paper tapes. Wish I had a punch and reader now.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • HumanoidoHumanoido Posts: 5,770
    edited 2009-01-16 15:39
    Tiny Basic was implemented on the Intel 8080/8085 and the original archived
    discussion page, reconstructed (with help from Volume 17 of the CP/M User's
    Group archives), is found here:

    MINOL-Tiny BASIC with Strings in 1.75K Bytes
    web.archive.org/web/19980702115208/http://www.signiform.com/erik/pubs/minol.htm

    Note the letter by Erik T. Mueller
    Erik T. Mueller
    said...

    Dear Mr. Warren: May 1, 1976
    I have a Tiny BASIC program running on my Altair
    that I think you might be interested in. I call it MINOL.
    It fits in 1.75K memory. Unlike the other Tiny BASIC's,
    MINOL has a string-handling capability, but only
    single-byte, integer arithmetic and left-to-right
    expression evaluation.
    Additions to TB include CALL machine-language sub-
    routines, multiple statements on a line (like TBX), and
    optional "LET" in variable assignments. Memory locations of
    the form (H,L) can be used interchangably with variables, per-
    mitting DIM-like operations.
    Sincerely,
    Erik T. Mueller
    This information was updated 27 times. While the original posting from "Dr.
    Dobb's Journal of Computer Calisthenics and Orthodontia" no longer links the
    Tiny Basic listing or file, just scroll down farther on the page and provided is a
    listing of the 8080/8085 Tiny Basic code manually typed which can be copied
    and pasted from the html page!

    You can consult the more recent versions as archived links here (as I chose
    the oldest link from Jul 02, 1998).

    web.archive.org/web/*/http://www.signiform.com/erik/pubs/minol.htm

    The newest link is here, from Sep 28, 2007.
    web.archive.org/web/20070928040139/http://www.signiform.com/erik/pubs/minol.htm

    Thanks to the Internet Archive WayBack Machine.
    www.archive.org/web/web.php

    At originally only 1.75K, a working version on the Prop would be absolutely remarkable.

    humanoido

    Post Edited (humanoido) : 1/16/2009 3:52:58 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-16 15:45
    I haven't looked at it much, but there is a "tiny" Basic on the Hydra CD written mostly in Prop assembler. It occupies a couple of cogs, so we're talking about 1K to 1.5K instructions.
  • heaterheater Posts: 3,370
    edited 2009-01-16 16:28
    As it happens there is a MINOL on the altairz80 simulator site. I never knew that it was a tiny basic ! I'll see I can get it to run on PropAltair.

    I was just reading a about a guys original 1975 Altair who states that he was getting 350K instructions per second. So propAltair is doing a fairly accurate emulation of the speed of an 8080 [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • heaterheater Posts: 3,370
    edited 2009-01-17 08:51
    By popular request (humanoido) here is PropAltair running the tiny basic version called MINOL.

    This makes the HUB RAM look huge !

    This is the end of the line for stand alone BASICs from me, time to get back to the "real work" of improving CP/M on the Prop.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.

    Post Edited (heater) : 1/17/2009 9:09:53 AM GMT
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-01-17 13:51
    Absolutely fascinating you can fit these programs on the altair simulator.

    Hopefully that CP/M board will get to you heater in the next week and you can see if it is possible to squeeze it into a propeller.

    I'm working on making complex code easier to write. Coloured text and cut and paste and quick compiles have certainly sped up the edit/test/edit/test cycle. Back in the CP/M day the text editors were much more cumbersome by comparison. And my dad was telling me that back in his day (1960s) you had paper tape and you would "load" a program, which in practice meant a girl would go and get a roll of tape and feed it into a machine which would spit it across to the other side of the room and another girl would grab the tape and roll it all up and file it away. Serves me right for complaining about compiles that take more than 10 seconds!

    Languages. A can of worms I know. I've got frustrated with the smaller languages and I'm working with s-basic at present because it is much more structured than other forms of basic, and so you can add new keywords as functions and hence enlarge the language as needed. It looks more like spin than mbasic for instance. But with modern programming like richtextboxes in .net, you can add things like syntax colouring and dop in functions from a menu. The attached screenshot is a vb.net program, with a VT100 terminal in the top window talking to a N8VEM CP/M board, and in the lower windows is the s-basic program. Compile is a single step process which sends the program to the N8VEM via xmodem and then runs the sbasic compiler. You can write little programs and store them in the on-board ramdisk - eg a program to change the baud rate, and another to change the serial port. Just for fun, the N8VEM board is on the other side of the house and is communicating via wireless modules.

    I can see a convergence of ideas here. Either CP/M being emulated fully on the Prop. Or an Prop operating system evolving to the stage of being able to write and compile programs on its own board.
    798 x 704 - 100K
  • heaterheater Posts: 3,370
    edited 2009-01-17 17:00
    Dr A

    It's been fascinating to get them running on the Prop, in fact it's diverted me for too long from the real business CP/M. The real honour goes to people like Erik T. Mueller for creating things like Minol in 2K bytes back in 1976. And here we are today complaining that the COGs don't have enough registers and the HUB ram is too small. Young people today, I don't know.....

    Paper tapes and punch cards is where I started out back in uni. Was just a tad before micros started to arrive on the scene.

    Wireless communication, colour syntax highlighting, wow, you must have the most sophisticated CP/M development environment ever created ! Here I'm still doing most of my debugging via the 8 LEDs on a Prop demo board, just like the old days.

    When I get the external RAM sorted full scale CP/M will be running on the Prop. As for a self hosting prop operating system I think others here are working on it.

    By the way if I took the time to figure out how to use Digital Researches ASM and the WM editor I think I can already do program development for CP/M. They both seem to run in 24K.

    Just now I'm stuck by a CPU instruction set test program by MICROCOSM ASSOCIATES that fails on PropAltair. And Guess what ? It trips up on that pesky DAA opcode.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • heaterheater Posts: 3,370
    edited 2009-01-17 21:23
    Attached is propaltair running an 8080 instruction set test program.

    Problem is propaltairs DAA instruction fails (Test currently disabled), this is driving me nuts. As far as I can tell the DAA implementation is as per my 8080 assembly language programming manual. The tests I made for it worked and it gives the correct results when used by the survey.com program, the only program I know that uses it for real.

    Searching around the net it seems many have had trouble with this in their simulator attempts. The z80 does not set flags exactly as 8080. The 8080 is considered buggy in this respect. But I could not find exactly what the issue is.

    Anyone have any info on this ?

    Otherwise emulation seems to be solid.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • AleAle Posts: 2,363
    edited 2009-01-17 21:56
    heater,

    I think you may know this people: http://www.altairkit.com

    There is a forum where issues are discussed, http://www.stockly.com/forums/index.php, maybe they can run some test cases for you. I mean, they have real 8080s. (I only have a Z180 around, and DAA works as per the manual, well better because the Z80 manual I got a couple years ago had some mistakes in the DAA instruction description).

    I wanted to convert that tiny basic to propeller assembler. Someone did it but I mean I wanted smile.gif. I have some problem with the 8080 opcodes, I know only the Z80 nomenclature.

    I hope it helps. Btw, great achivement !
  • heaterheater Posts: 3,370
    edited 2009-01-17 22:25
    Thanks Ale, I will check out those links.

    I've just found an Manual from Radio Shack that covers both 8080 and 8085 programming. It does mention differences in flag handling between the two. Which, as I said, is different from z80. The issue seems to be that the half carry flag may or may not be set by logical operations depending on cpu and phase of the moon. Neither of my manuals actually have all the details of this.

    Looking at the code for DAA in the GNU 8085 simulator I can't see how that conforms to any manual description !

    Baa ! I might just leave it as it is for now and get on with something else.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2009-01-17 23:51
    Once you get that board it will help, but I wonder if it might be worth testing it on a real Z80 and just looking at the flags. It is easy enough to do with ZDT or DDT. All that would be needed is the state of all the registers (including the flag regsiter) just before DAA is run. Have you got a code example?
Sign In or Register to comment.