+ Reply to Thread
Page 4 of 6 FirstFirst 123456 LastLast
Results 61 to 80 of 111

Thread: MoCog - A Motorola 6809 emulator for the Propeller

  1. #61

    Default

    Ale: "The use of 2 "jump addresses" inside one long in the tables is quite smart."

    That whole idea is not mine but down to Cusso. It was a very nice fit for the Z80 simulator. In that case having the op-code decoding mostly done in the dispatch tables gained a lot of speed and saved COG space. A lot of Z80 ops are never used (in the CP/M world anyway) so who cares if they get farmed out to slower overlays or LMM?

    Just now it is not working so well for the 6809 where there are no ops we can ignore and the indexed addressing modes eat a lot of time and space to decode.

    I have to say, just now I'm all burned out for this emulator business.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  2. #62
    Cluso99's Avatar
    Location
    Sydney/Brisbane Australia or 'sailing on the high seas'
    Posts
    10,170

    Default

    Ale: In fact I use 3 jump addresses and 5 bit flags in my jump table in the Fast Spin Interpreter (source posted - see tools link in my signature for the link)

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

    Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,SixBlade, website
    Single Board Computer:3 Propeller ICsand aTriBladeProp board (ZiCog Z80 Emulator)
    Prop Tools under Development or Completed (Index)
    Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
    Search the Propeller forums (via Google)
    My cruising website is: www.bluemagic.biz MultiBladeProp is: www.bluemagic.biz/cluso.htm
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  3. #63

    Default

    Hi heater,

    here is the compiled mocog linux emulator version.

    I wonder about the speed. Should DIRA toggle between $8 and 0 every 3 seconds?

    to start simualtion:

    ./promsim.out
    Attached Files Attached Files
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  4. #64

    Default

    Chris: No. If you compile MoCoG with PROP_DEMO_BOARD and HEARTBEAT defined then it should write to dira once to set the LED pin to output and then write to outa once for every 6809 instruction, inverting the pin each time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  5. #65

    Default

    At least it seems to invert the pin. So in some way the code seems to be interpreted. Did you try to run it?
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  6. #66

    Default

    Not yet. Busy busy here. Perhaps this evening.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  7. #67

    Default

    OK I just found a moment to run MocogEMU.

    Did you compile a new MoCog for that? You should start with MoCog compiled with the PROP_DEMO_BOARD and SINGLE_STEP defines set (no HEARTBEAT).

    Then when it runs it should look like this:
    Code:
    MoCog v0.6
    Starting keyboard ...  Passed
    Starting disks (A:B:C:D:E:F:G:H:) ...  Passed
    RAM base = 00C8
    ROM base = 40C8
    Starting 6809 emulation... Passed
    PC=0000 20 D=0000 X=0000 Y=0000 U=0000 S=3000 DP=00 CC=00
    03E0 44 41 41 04 CE 04 1D 8E 04 05 A6 80 40 1F A9 A1
    03F0 80 10 26 0E 86 C4 0F E1 80 10 26 0E 7E 8C 04 1D



    Then it should step through another 6809 instruction every time any key is pressed.

    When I ran MocogEMU it did at least get the first register dump right. "PC=0000 20 ...." where the "20" is the first op code.

    After that it seems to want to output something every second which feels like maybe you don't have SINGLE_STEP defined. In which case it would run 6809 at full speed and then print the execution speed out once per second (Which would be zero if HEARTBEAT is not defined.)

    It's kind of spooky to see MoCog running on a PC.

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

    Post Edited (heater) : 7/17/2009 10:49:03 AM GMT
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  8. #68
    Cluso99's Avatar
    Location
    Sydney/Brisbane Australia or 'sailing on the high seas'
    Posts
    10,170

    Default

    Now we just need to get that PC emulation running on the prop......... lol

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

    Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,SixBlade, website
    Single Board Computer:3 Propeller ICsand aTriBladeProp board (ZiCog Z80 Emulator)
    Prop Tools under Development or Completed (Index)
    Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
    Search the Propeller forums (via Google)
    My cruising website is: www.bluemagic.biz MultiBladeProp is: www.bluemagic.biz/cluso.htm
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  9. #69

    Default

    >Now we just need to get that PC emulation running on the prop......... lol

    yes, if there is a 8086 Emulator

    But probably there is a gcc for the z80. In this case we could probably to a recursive emulation if we compile the propeller emulator for cpm

    In the attachment there is the source of mocog how I used it. I just replaced TV_Text.spin with EMU Text.spin and the same for the Keyboard.
    If you like to compile it with other options simply do it and save the result as text.binary.
    Then type

    ./propsim.out

    and the new code will run.
    Attached Files Attached Files
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  10. #70

    Default

    Chris, those #defines have to be set in both mocog.spin and mocog_demo.spin unless you set them in the BST options.

    Anyway I still get the same result.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  11. #71

    Default

    is it correct or not? If you presse a key, you will see

    8 outa
    0 outa
    8 outa
    ...
    outa is displayed if something is written to the ports of the propeller

    I had to made some compromise in the EMU Keyboard.spn : in linux there is no kbhit() so I simply set the return flag in the keystroke funktion to always true.
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  12. #72

    Default

    Oh yeah, for got to say, it is not correct.

    What should happen is:
    1) The MoCog spin starts up printing a sign on message and then starting some drivers.
    2) It starts the PASM emulation COG which breaks before executing the first 6809 op.
    3) The spin sees this break and prints the 6809 registers registers and a few of the 6809 RAM bytes.
    4) Spin then waits for any key press then allows the PASM to continue.
    5) The PASM executes one instruction.
    6) The PASM breaks again before the next instruction.
    7) and so on.

    So after the first register dump, hitting a key should execute one op and dump the regs again.

    PC=0005 7F D=0000 X=0000 Y=0000 U=0000 S=3000 DP=00 CC=00
    03E0 44 41 41 04 CE 04 1D 8E 04 05 A6 80 40 1F A9 A1
    03F0 80 10 26 0E 86 C4 0F E1 80 10 26 0E 7E 8C 04 1D

    That "7F" above is the opcode about to be executed. If this was stepping nicely you could follow along with the ex6809.lst file.

    Unless HEARTBEAT is defined the emulator does no output to pins.

    Ah, I just found that those 0's and 8's are coming from the sdspiqasm driver. Commenting out the disk.out() gets rid of them.

    Now it is just stuck after hitting return.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  13. #73

    Default

    Chris any chance a version of propsim that dumps out the addresses of each PASM instruction as they are executed. Then I could follow through the MoCog code and see where it goes wrong.

    Have to be sure it's dumping the right COG somehow.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  14. #74

    Default

    heater said...
    Chris any chance a version of propsim that dumps out the addresses of each PASM instruction as they are executed.
    Yes sure, simply start propsim with

    ./propsim -d

    type h<ret> to see the commands.
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  15. #75

    Default

    Much to confusing. How can I trace only the 6809 cpu COG starting from when it is first loaded?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  16. #76

    Default

    The best thing is probably to use only to cogs:

    you simply call your 6809 emulator code somehow with

    coginit(@6809,@data)

    start the propeller emulator with

    ./propsim -d

    then the spin interpreter is loaded an started.

    Then you type return until you see the coginit instruction.

    If this instruction was executed, the next cog is loaded ( in this case cog1 )
    If you type "1" cog 1 will be traced.

    Simply type return to trace through the single instructions.

    Post Edited (Chris Micro) : 7/20/2009 3:35:46 AM GMT
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  17. #77

    Default

    heater said...
    [snip]

    When I get a chance I think the next thing is trying to fix the flag settings and get Motorola's assist09 debug monitor running.

    So far I have yet to find a nice instruction set exerciser to test this with like EX80 for the Z80.
    Heater,
    This weekend I got ASSIST09 debug monitor working on the N8VEM 6809 host processorwith IO mezzanine board. Basically its the N8VEM 6809 host processor with an IO board stacked on top (ACIA, PTM, & 2 VIAs). Having real serial port and timer makes life much easier. The code is unchanged from the original Motorola code except for the memory locations of ACIA and PTM and the console IO code is for an 6551 ACIA compared to whatever Motorola was using for their ACIA (MC6850, maybe sort of).

    You are welcome to whatever material I have on the 6809 to help your project.

    Thanks and have a nice day!

    Andrew Lynch
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  18. #78

    Default

    @Andrew: It's nice of you to think of MoCog and I may well want to make use of anything you have at some point but..

    In case any one is wondering, MoCog is on a bit of a hold right now due to pressure of, well, everything else in life.

    I've pretty much decided that it's PASM will have to be split over two (or more) COGs rather than use the current overlay system in one COG. Specially has now PhilPilgrim has shown a very neat method of making remote COG calls.

    This will take a little time....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  19. #79

    Default

    There's another CoCo3 FPGA project at this here Yahoo Group: http://groups.yahoo.com/group/CoCo3FPGA/

    I'm still waiting on membership approval, but they do have a booting system I know. Not sure how useful their insights might be to you, but it is a 6809 system.
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

  20. #80

    Default

    Interesting, hope to find time to check that out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
    Last edited by ForumTools; 09-30-2010 at 04:42 PM. Reason: Forum Migration

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts