Shop OBEX P1 Docs P2 Docs Learn Events
SX Emulator for Propeller — Parallax Forums

SX Emulator for Propeller

BeanBean Posts: 8,129
edited 2009-08-11 18:34 in Propeller 1
This is just the beginning of my SX Emulator for the Propeller.
Could some of you Propeller Gurus look and see if I'm doing anything stupid so far ?
Keep in mind this is just the beginning framework for the emulator.

Thanks,
Bean.


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Does that byte of memory hold "A", 65, $41 or %01000001 ?
Yes it does...

Comments

  • heaterheater Posts: 3,370
    edited 2009-08-11 15:54
    I don't think you want all those @'s in the jump table entries.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • heaterheater Posts: 3,370
    edited 2009-08-11 16:13
    Actually before I start to look at this too hard am I reading the correct data sheet?
    I've just opened up " Ubicom SX Family User’s Manual"

    It says an opcode is only 12 bits. e.g. "JMP addr9" is "101k kkkk kkkk".

    So fetching instructions with just a read word does not seem quite right. Or are you planning on "stretching" the ops.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Bill HenningBill Henning Posts: 6,445
    edited 2009-08-11 16:18
    The emulator will take a big speed hit already, trying to pack to 12 bits would make it much slower again [noparse]:)[/noparse]

    Using words and ignoring the upper four bits makes a lot of sense.
    heater said...
    Actually before I start to look at this too hard am I reading the correct data sheet?
    I've just opened up " Ubicom SX Family User’s Manual"

    It says an opcode is only 12 bits. e.g. "JMP addr9" is "101k kkkk kkkk".

    So fetching instructions with just a read word does not seem quite right. Or are you planning on "stretching" the ops.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
    Morpheus & Mem+ Advanced dual Propeller SBC with XMM and 256 Color VGA - PCB, kit, A&T available NOW!
    www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
    Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
  • Bill HenningBill Henning Posts: 6,445
    edited 2009-08-11 16:26
    Hi Bean,

    First, I would use PC directly - I would re-write the interpreter loop as:

    NextInstr
      rdword instr,PC
      mov  decode,instr
      shr decode,#4
      add decode,#jumptablebase
      movs, DoJump,instr
      add pc,#2
      add rtcc,#1
    DoJump jmp 0
    
    jumptablebase long opclass0,...,opclass15
    
    
    



    I just shaved three instructions off for you!
    Bean (Hitt Consulting) said...
    This is just the beginning of my SX Emulator for the Propeller.
    Could some of you Propeller Gurus look and see if I'm doing anything stupid so far ?

    Keep in mind this is just the beginning framework for the emulator.



    Thanks,

    Bean.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
    Morpheus & Mem+ Advanced dual Propeller SBC with XMM and 256 Color VGA - PCB, kit, A&T available NOW!
    www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
    Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
  • BeanBean Posts: 8,129
    edited 2009-08-11 16:31
    Bill, thanks for the tip, but then PC will not contain the value is should. I guess that could be handled when decoding the instructions that access PC (Like JMP W+PC).

    Right now I'm not too worried about speed or doing anything "clever". I'm just trying to get something going.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Does that byte of memory hold "A", 65, $41 or %01000001 ?
    Yes it does...


    ·
  • heaterheater Posts: 3,370
    edited 2009-08-11 16:42
    Makes sense. I just have to get my brain into 12 bit mode.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • Bill HenningBill Henning Posts: 6,445
    edited 2009-08-11 16:53
    You are welcome!

    It does make sense to get it running first...
    Bean (Hitt Consulting) said...
    Bill, thanks for the tip, but then PC will not contain the value is should. I guess that could be handled when decoding the instructions that access PC (Like JMP W+PC).

    Right now I'm not too worried about speed or doing anything "clever". I'm just trying to get something going.

    Bean.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
    Morpheus & Mem+ Advanced dual Propeller SBC with XMM and 256 Color VGA - PCB, kit, A&T available NOW!
    www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
    Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-08-11 18:34
    Bean: Just get it running simply at first. You will find there will be many ways to make the code faster, but this will often only become evident after you are way into the code when you discover commonality between sections. When you are ready, look at my jump tables in the spin interpreter or heaters ZiCog. It is very fast and efficient and stores 3 routines and 5 bits for multiple routines within an instruction.

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

    · Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
    · 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) ZiCog (Z80), MoCog (6809)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Sign In or Register to comment.