Shop OBEX P1 Docs P2 Docs Learn Events
MoCog - A Motorola 6809 emulator for the Propeller — Parallax Forums

MoCog - A Motorola 6809 emulator for the Propeller

heaterheater Posts: 3,370
edited 2014-09-15 11:45 in Propeller 1
Introducing MoCog an emulation of the Motorola 6809 microprocessor for the Propeller.

In the few slack moments I have nowadays I have been converting the ZiCog Z80 emulator into a 6809 emulator. As usual with me this is a very unfinished early release. There is a lot of code in place but very little is tested. So far it just about single steps its way through a short loop of

NOP
ADDA $01
JMP $0000

No flag setting is in place.

This should compile with BST or homespun for the Prop Demo Board if the following defines are set: "PropDemoBoard" and "SingleStep".

Just compile, download and watch the output in the terminal window of BST or ProTerminal or whatever. Hit any key to take single steps through the loop.

I have left Cluso's code for the TriBladeProp platform (external RAM) in place but It's best he reviews it I guess.

What's this for? No idea but I want to see CUBIX running on the Prop possibly followed by FLEX, SK*DOS and/or One MAn Unix (OMU).

Edit: 8 Jul 2009 Latest version is 0.5. All op-codes now in place. Runs a GCC compiled test program (See the ram_6809 area in mocog_demo.spin). Not many ops do any flag setting yet.

Edit: 14 Jul 2009. Latest version is 0.6. Changed to run a 6809 test program. All addressing modes are working. Most other ops not yet. But at least the tests run !!!

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

Post Edited (heater) : 7/14/2009 5:04:16 PM GMT
«134

Comments

  • LeonLeon Posts: 7,620
    edited 2009-05-28 16:43
    I've played with John Kent's Xilinx FPGA 6809 emulation. It runs Flex.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • mikedivmikediv Posts: 825
    edited 2009-05-28 20:39
    Leon do you have a copy of Flex that will work with this or any 6800/09 ???
    I have been using flex with my SWTP for years and just had an accident with my 5 /14 floppies I lost every single program 20 years worth of Motorola .Flex and OS9 lost everything I want to cry
    I only had backed it up to more floppies since my computers could only read the floppies I am still in shock I had just dug everything back out since not using for years but now that I have been playing with the props and this forum it
    got me motivated to setup all the old stuff again I even had an old STD bus 8080 system lost those disks as well
  • LeonLeon Posts: 7,620
    edited 2009-05-28 20:54
    Here's John's web page for his 6809 project:

    members.optusnet.com.au/jekent/system09/index.html

    He's got some Flex stuff you can download.

    I can't remember if I actually bothered to try Flex when I was playing about with it.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • heaterheater Posts: 3,370
    edited 2009-05-28 22:01
    mikedev: Try asking the FLEX user group www.flexusergroup.com/flexusergroup/fug1.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • rokickirokicki Posts: 1,000
    edited 2009-05-28 22:56
    mikedev: there are a lot of emulators available; is everything
    irretrievably lost? are the backup disks broken too?
  • nightwingnightwing Posts: 56
    edited 2009-05-29 02:56
    Along with FLEX there was Smoke System Broadcasting and Computerware. SSB was a rebadge Computerware.

    Out standing! Sure nice to see a 6809 emulator!

    Wonder if a 6847 could be emulated for video. Spects are about the same as so far what im learning on the Prop..
  • jazzedjazzed Posts: 11,803
    edited 2009-05-29 03:01
    Nice work heater.
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-05-29 03:12
    Congratulations heater. Another emulation and all it's goodies on the way.

    You know, with a minimal SD boot code, we can change the emulator from CPM to Flex to PropDos on the fly, or just change the SD to swap.

    Makes the prop far more versatile, doesn't it smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • AleAle Posts: 2,363
    edited 2009-05-29 05:12
    Well, one a 68k emulator is needed now wink.gif, great work heater !

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit the home of pPropQL, pPropQL020 and OMU for the pPropQL/020 at omnibus.uni-freiburg.de/~rp92
  • heaterheater Posts: 3,370
    edited 2009-05-29 05:50
    "a 68k emulator is needed now" Oh yes. But I'm not your man for that job. I have to draw a line somewhere and get on with some other interesting projects[noparse]:)[/noparse]

    Still if Cluso or someone were to come up with a 16 bit wide external RAM bus I might be tempted....

    Yes I know there was a 68008 but things are slow enough already. Perhaps it should wait for the Prop II.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • TonyDTonyD Posts: 210
    edited 2009-05-29 09:20
    Joel Ewy at 8littlebits.wordpress.com/ has a short but interesting blog about implementing a CoCo3 in a FPGA as well as some stuff about bringing an old SWTPC 6809 computer back to life.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Tony

    http://zuzebox.wordpress.com/
  • nightwingnightwing Posts: 56
    edited 2009-05-29 09:34
    The Coco3 were weird with the chip Tandy had custom made. Think would be ease to emulate a Coco 1/2 with a 6847 and duo 6821.

    The Coco III had that bank memory switching in out via the Gimi chip. And the other weird video modes beyond a regular Coco 1/2.

    Congrats on the emulator!
  • AleAle Posts: 2,363
    edited 2009-05-29 10:04
    heater: As you say it is slow enough :-(. That is why I put a real 68k together with a couple of props. Let's see if my new 020 board works as expected (programmable logic saves the day!).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit the home of pPropQL, pPropQL020 and OMU for the pPropQL/020 at omnibus.uni-freiburg.de/~rp92
  • mikedivmikediv Posts: 825
    edited 2009-05-29 16:41
    Hey guys thanks everyone , funny story I have a huge box with all my floppies from 3-1/4, 5, 8 . and of course I have to put it away (so its not messy wife stuff)) even though it my office .
    Anyway I have a huge and I mean huge 48 LB magnetic sweeper for picking up steel at a construction site , nails scrap metal stuff like that this thing can pick up car ,,well almost but you get the idea
    I scored it at a swap meet a few weeks ago, You can never have a strong enough magnet and since its been my dream to build a time machine for 50 bucks I thought I made the best deal in world.
    Well you can see where this is going , its on wheels so you can push it like a vacuum cleaner .. Well guess where wifey decided to park it !!! yup right next to my huge box of 30 years of floppy disks collection
    from windows 2.0 Beta, Xerox experimental windows that ran on an RCA 1802 , CPM86 , MS-Dos , Flex, OS9, Planet 9, OSX, Wave, HP UNIX, SCO you name it if it was made I had a copy on floppy I even had PDP-11 and IBM 360 anyone remember that?
    And not to show my age but if anyone remembers when only real men had computers and they had switches and LED's and tape recorders for storage and 256 BYTES of RAM! well there was this ancient at the time cutting edge
    BBS(remember those),lol called the "Pirates Den" he was arrested and shut down but had a whole BBS dedicated to boot leg software 300 baud modem connection high tech stuff at the time well I had the entire collection of his BBS

    The funny thing is most of these disks were stored in there own cases made of wood and plastic but his box is 38X42X28 with all the separate storage containers floppies inside ,,Everything was erased and I mean everything
    it sat like that on top of the magnet for weeks I guess but you would think there would be some bits left but they are all Blank there is nothing to recover its like everyone was individually erased. I tried to read sectors one at a time
    but you can not believe how blank they are. even the furthest from the magnet disk are completely erased I don't think I could have done a better job on purpose. even crazier I had some digital storage tapes ,backups of some of the stuff in with the floppies
    , they are blank as well I wonder if the closet setup up some kind of magnetic amplification?? Who knows its just day I lost all the stuff if anyone is in need of blank floppies let me know I don't have any use for them now

    Oh guys I have all the Flex and OS9 manuals as well as the actual assembly code in print for Flex and the boot roms I even have a printed copy of code for OS9 for the radio shack color computer if anyone wants a copy I would be happy to share it with you
    I was thinking maybe there is some way I can scan it into the computer and recompile it and make a boot disk ????? Anyway just ask if you want anything

    Post Edited (mikediv) : 5/29/2009 4:48:13 PM GMT
  • mparkmpark Posts: 1,305
    edited 2009-05-29 18:14
    That should give you plenty of incentive to complete your time machine and go back to prevent this mess.
  • heaterheater Posts: 3,370
    edited 2009-05-29 19:37
    That story makes me feel sick.

    Is your wife still alive?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • rokickirokicki Posts: 1,000
    edited 2009-05-29 20:54
    Oh my God.

    This is one very good reason I don't mess with large magnets. Geomags is as large as I go, and I
    keep them away from computers.

    There's a story on the web about someone's magnetic billfold clasp destroying hard drive after hard
    drive in a Macintosh laptop. No idea how factual it is.

    I cut my teeth on an SWTP two-terminal system; that thing was so great! Basic09 and an HP pen
    plotter; big old beautiful terminals; we had a blast with that system. I was totally OS9, though; no
    Flex for me.

    It sounds like you have a lot of very valuable artifacts, in any case.

    I'm sure you can find the bits you need online, or at least a Flex club member online who can provide
    you with boot disks and the like. And frankly, getting in touch with others with your particular hobby,
    can be very rewarding.

    I still have a pile (literally) of Color Computers of various makes in my computer room. I just cannot bring
    myself to throw them away. I think I have at least six working machines.

    (Edited to remove wording which may be misconstrued or offensive to some.)

    Post Edited (rokicki) : 5/29/2009 8:59:52 PM GMT
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-05-30 03:14
  • heaterheater Posts: 3,370
    edited 2009-06-15 11:32
    Here is MoCog version 0.2

    Still nowhere near complete but pretty much all arithmetic/logic ops have code in place and do what they should. No flags settings in place yet. Immediate, Direct and Extended addressing modes are working.

    Speed is up to 458KIPS for single byte instructions.

    Now the real reason for this post. Can someone point me at a nice 8-bit by 8-bit unsigned multiply with 16-bit result for the MUL instruction?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-06-15 11:46
    Heater: Chip's spin interpreter might be a good place to start.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • lynchajlynchaj Posts: 87
    edited 2009-06-15 11:52
    Hi! This is a bit off topic but since there has been some great cooperation between the Propeller fans and the N8VEM home brew computing project I thought this would be OK.

    I just received several PCBs for the N8VEM 6809 host processor board. It is a real 6809 that plugs into the N8VEM ECB as a peripheral. The Z80 SBC acts as the IO processor for the 6809 so you have full access to all the N8VEM peripherals and tools.

    The only software I have running on the 6809 host processor is a modified version of the Motorola minibug software. I would love to get a FLEX port going.

    If you are interested please contact me. Thanks and have a nice day!

    Andrew Lynch
  • heaterheater Posts: 3,370
    edited 2009-06-15 12:01
    Andrew, never mind the off topic. I think the N8VEM project is great and now it looks like it's keeps getting even better. Wish I had time to play, just now MoCog takes up all my spare minutes when I have them.

    For sure FLEX is on the (distant) horizon for MoCog as well. Just now I have little idea about it or what it will take to get it up and running. So perhaps I will need to pick your brains about it sometime as I think you will get there first.

    Anyway I want to get CUBIX up and running first as porting it is very well documented and all the source is available.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • heaterheater Posts: 3,370
    edited 2009-06-15 12:04
    Clusso: Yes I was thinking of Chips interpreter but I can never find anything of the forums when I want it. Not search.parallax.com either. Annoying because I saved a copy somewhere a few PC's back.

    Any idea where it is?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • heaterheater Posts: 3,370
    edited 2009-06-15 15:57
    OK, nothing forthcoming on the MUL. Whilst I was waiting I made this which sees to work.
    After that first rdword the alu contains 8 bit A reg and 8 bit B reg as a word (A high)

    Any suggestions/improvements appreciated.

    mul
                            rdword  alu, d_reg
                            mov     data_16, alu
                            andn    data_16, #$FF
                            shl     data_16, #15
    
                            shr     alu, #1 wc
                  if_c      add     alu, data_16
    
                            shr     alu, #1 wc
                  if_c      add     alu, data_16
    
                            shr     alu, #1 wc
                  if_c      add     alu, data_16
    
                            shr     alu, #1 wc
                  if_c      add     alu, data_16
    
                            shr     alu, #1 wc
                  if_c      add     alu, data_16
    
                            shr     alu, #1 wc
                  if_c      add     alu, data_16
    
                            shr     alu, #1 wc
                  if_c      add     alu, data_16
    
                            shr     alu, #1 wc
                  if_c      add     alu, data_16
    
                            shr     alu, #16
                            wrword  alu, d_reg
                            jmp     #fetch
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-06-16 03:39
    Heater: Here is the link to the Spin Interpreter (my faster version). It also contains a full listing (homespun) of Chip's Interpreter.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • heaterheater Posts: 3,370
    edited 2009-06-16 05:52
    Cluso: Where?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • BradCBradC Posts: 2,601
    edited 2009-06-16 07:54
    heater said...
    Clusso: Yes I was thinking of Chips interpreter but I can never find anything of the forums when I want it. Not search.parallax.com either. Annoying because I saved a copy somewhere a few PC's back.

    Any idea where it is?

    Always keep a copy handy [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Eccles : How do I open the door?
    Bluebottle : You turn the knob on your side
    Eccles : I haven't got a knob on my side!
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-06-16 08:30
    OOPS - I must have forgotten to paste the link

    http://forums.parallax.com/forums/default.aspx?f=25&m=273607

    I have listed these things under "Prop Tools under development" in my signature links. This is the reason I did this - because likewise, I can never find anything on the forum when I want it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • heaterheater Posts: 3,370
    edited 2009-06-16 08:38
    Thanks BradC. Interesting, 4 instructions in the main loop. Think I'll stick with my 3 instruction loop.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • heaterheater Posts: 3,370
    edited 2009-06-16 09:00
    Hmm.. nice. Looks like we can do MUL instructions at 334 thousand per second. Not bad.
    (384 thousand per second for the unrolled loop, but I don't think it will fit in the end)

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

    Post Edited (heater) : 6/16/2009 9:06:11 AM GMT
Sign In or Register to comment.