Shop OBEX P1 Docs P2 Docs Learn Events
HUB EXEC Update Here - Page 2 — Parallax Forums

HUB EXEC Update Here

2456716

Comments

  • SapiehaSapieha Posts: 2,964
    edited 2014-01-27 04:01
    Hi Chip.

    Now I have looked on most instructions AND ---> JMPLIST is good to JUMP in function tables
    BUT I still are missing its counterpart
    > CALLIST for simple Call that tables

    Sapieha wrote: »
    Hi Chip.

    JMPLIST jumps to a base address (S/@/@@) plus index (D).

    Why You not named this instruction ---> JMPRELS ---
    I think that name are more logical
  • cgraceycgracey Posts: 14,206
    edited 2014-01-27 06:51
    Sapieha wrote: »
    Hi Chip.

    Now I have looked on most instructions AND ---> JMPLIST is good to JUMP in function tables
    BUT I still are missing its counterpart
    > CALLIST for simple Call that tables


    Calls are lot more expensive than jumps, in terms of op-code requirements. A call must not only express address, but which stack to use. So, it's best to call to a JMPLIST instruction.
  • rjo__rjo__ Posts: 2,114
    edited 2014-01-27 08:33
    I am able to get to the ROM Monitor by rebooting and hitting the space bar, but I can't get ROM_Monitor.spin to run(Nano).
  • cgraceycgracey Posts: 14,206
    edited 2014-01-27 08:44
    rjo__ wrote: »
    I am able to get to the ROM Monitor by rebooting and hitting the space bar, but I can't get ROM_Monitor.spin to run(Nano).

    You need to launch it with some pre-code that establishes RX/TX pins. I'll post an example shortly.
  • rjo__rjo__ Posts: 2,114
    edited 2014-01-27 08:52
    Thanks. Incredible stuff… seems like it shouldn't be possible:)
  • bartgranthambartgrantham Posts: 83
    edited 2014-01-27 10:45
    cgracey wrote: »
    Leon, I believe we are making some more DE0-Nano adapter boards. If so, we'll send you one.

    I have been anxiously awaiting a new batch of DE0-Nano adapter boards since last summer, please sign me up for one, too!
  • cgraceycgracey Posts: 14,206
    edited 2014-01-27 11:01
    rjo__ wrote: »
    I am able to get to the ROM Monitor by rebooting and hitting the space bar, but I can't get ROM_Monitor.spin to run(Nano).

    You need to put this code at the very start of the Rom_Monitor.spin file:
    DAT
    		orgh	$380
    
    		org
    
    		coginit	monitor_pgm,monitor_ptr,#0
    
    monitor_pgm	long	@entry
    monitor_ptr	long	91<<9 + 90
    
    monitor
    		org
    


    That will launch it and reset the org, with the Rom_Monitor code following.
  • RaymanRayman Posts: 14,755
    edited 2014-01-27 12:26
    This looks pretty neat although I'm still trying to see if I understand it...
    Is this similar to the XMM modes of PropGCC and Catalina?

    Never mind, that was a dumb question...

    I guess it's similar in that you can write Assembler code bigger than cog space.
    XMM lets you write C code bigger than HUB space...
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-01-27 12:43
    XMM is LMM for external memory

    LMM used to be needed to write code larger than what will fit in a cog

    hubexec makes LMM obsolete, and is MUCH faster :)

    At the moment, there are no compilers for hubexec mode, but that is certain to change as it is simpler and faster than LMM.

    XMM and CMM will still be around.

    Rayman wrote: »
    This looks pretty neat although I'm still trying to see if I understand it...
    Is this similar to the XMM modes of PropGCC and Catalina?

    Never mind, that was a dumb question...

    I guess it's similar in that you can write Assembler code bigger than cog space.
    XMM lets you write C code bigger than HUB space...
  • RaymanRayman Posts: 14,755
    edited 2014-01-27 12:46
    Ok, that makes sense, thanks. I'll think of it as a faster version of LMM.
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-01-27 13:04
    You are welcome!
    Rayman wrote: »
    Ok, that makes sense, thanks. I'll think of it as a faster version of LMM.
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-01-27 13:06
    Chip,

    I took a break from writing documentation, and read the new p2 docs.

    I found two potential errors:

    Line 1850, DAC's

    I thought we now had more restrictive mappings on video outputs?

    Line 2693, Pin transfers

    Should the QUAD's not be changed to WIDE's? (8 longs)
  • cgraceycgracey Posts: 14,206
    edited 2014-01-27 13:52
    Chip,

    I took a break from writing documentation, and read the new p2 docs.

    I found two potential errors:

    Line 1850, DAC's

    I thought we now had more restrictive mappings on video outputs?

    Line 2693, Pin transfers

    Should the QUAD's not be changed to WIDE's? (8 longs)


    Thanks for pointing that out. Cluso had noticed some errors mentioning QUADs, and I changed those this morning to WIDEs. There were some other QUAD mentions that needed changing to WIDE, too. I didn't think about this DAC stuff. I'll get that a little later. Right now I'm implementing the LOCPTRA/LOCPTRB instructions that you thought of. I was able to forge some op-code space by making LOCINST always have an @S, since the S case was just a MOV. So, it's not too disruptive, thankfully.
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-01-27 13:57
    You are welcome!

    Thanks Chip. LOCPTRA/LOCPTRB will be very useful to have.
    cgracey wrote: »
    Thanks for pointing that out. Cluso had noticed some errors mentioning QUADs, and I changed those this morning to WIDEs. There were some other QUAD mentions that needed changing to WIDE, too. I didn't think about this DAC stuff. I'll get that a little later. Right now I'm implementing the LOCPTRA/LOCPTRB instructions that you thought of. I was able to forge some op-code space by making LOCINST always have an @S, since the S case was just a MOV. So, it's not too disruptive, thankfully.
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-01-27 14:05
    Chip decided to add LOCPTRA and LOCPTRB - so before y'all ask what they are...

    JMP/CALL have an embedded 16 bit hub (long) address, and can reference an instruction anywhere in the hub.

    LOCPTRA / LOCPTRB add to Chip's LOCxxxx instructions by allowing PTRA and PTRB to be set to any long-aligned hub address in a single instruction by embedding a 16 bit hub address (absolute or relative).

    This will help greatly with accessing tables and arrays, including relative addressing of longs & arrays.

    LOCPTRA #hubaddress - extends 16 bit constant to 18 bits by appending two zeros and loads PTRA with that value
    LOCPTRA @hubaddress - computes relative offset from PC, extends to 18 bits, and loads PTRA with that value

    LOCPTRB #/@ behave the same way.

    This allows addressing any element in a 64 entry (byte/word/long) table with:

    LOCPTRA @table
    RDLONG element,PTRA[(-32..31) * scale]

    With optional pre/post decrement/increment, so it can also walk arrays

    LOCPTR{A|B} lower memory usage by saving one long on every array reference, and also support a "frame pointer" for small/medium size stack frames.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-01-27 14:16
    Chip decided to add LOCPTRA and LOCPTRB - so before y'all ask what they are...

    JMP/CALL have an embedded 16 bit hub (long) address, and can reference an instruction anywhere in the hub.

    LOCPTRA / LOCPTRB add to Chip's LOCxxxx instructions by allowing PTRA and PTRB to be set to any long-aligned hub address in a single instruction by embedding a 16 bit hub address (absolute or relative).

    This will help greatly with accessing tables and arrays, including relative addressing of longs & arrays.

    LOCPTRA #hubaddress - extends 16 bit constant to 18 bits by appending two zeros and loads PTRA with that value
    LOCPTRA @hubaddress - computes relative offset from PC, extends to 18 bits, and loads PTRA with that value

    LOCPTRB #/@ behave the same way.

    This allows addressing any element in a 64 entry (byte/word/long) table with:

    LOCPTRA @table
    RDLONG element,PTRA[(-32..31) * scale]

    With optional pre/post decrement/increment, so it can also walk arrays

    LOCPTR{A|B} lower memory usage by saving one long on every array reference, and also support a "frame pointer" for small/medium size stack frames.
    So many new toys to play with! :-)
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-01-27 16:42
    I continued to read the docs and found a few other things that I am unsure of...
    (I will use Lnnn/mm for Line nnn Column mm)

    L537/1: INDA/INDB are at $1F2/3 (presume this is correct)
    L404/1: Cog loads $0-$1F3 in 1017 clocks. (does it load INDA/INDB at $1F2-3 ???)
    L1415/1: Cog loads $0-$1F3 (same question)

    L2606/1+: Pin transfers... refers to quads - should these be wides??? (half asleep so didn't follow properly)

    Attached is an updated doc with a couple of typos fixed.
    Prop2_Docs(rr2).txt
  • cgraceycgracey Posts: 14,206
    edited 2014-01-27 19:15
    Cluso99 wrote: »
    I continued to read the docs and found a few other things that I am unsure of...
    (I will use Lnnn/mm for Line nnn Column mm)

    L537/1: INDA/INDB are at $1F2/3 (presume this is correct)
    L404/1: Cog loads $0-$1F3 in 1017 clocks. (does it load INDA/INDB at $1F2-3 ???)
    L1415/1: Cog loads $0-$1F3 (same question)

    L2606/1+: Pin transfers... refers to quads - should these be wides??? (half asleep so didn't follow properly)

    Attached is an updated doc with a couple of typos fixed.
    Prop2_Docs(rr2).txt


    After I worked in your prior edits, I found all the other QUAD references and fixed them, too.

    It's true that 0..$1F3 get loaded. Before you do a SETINDx/FIXINDx, those are just normal RAM registers, since they point to themselves.

    I'm hoping that I have time tonight to get a new update out which has the new LOCPTRx instructions and the fixed Prop2_Docs.txt file.
  • David BetzDavid Betz Posts: 14,516
    edited 2014-01-27 19:32
    cgracey wrote: »
    It's true that 0..$1F3 get loaded.
    I'm sure someone has suggested this before and it's probably too late in the game to even consider it but wouldn't it be nice to have a variant of coginit/cognew that starts a COG running in hub execution mode. This would let you start a new COG almost instantly without having to wait for almost 2K of data to be loaded.
  • cgraceycgracey Posts: 14,206
    edited 2014-01-27 19:50
    David Betz wrote: »
    I'm sure someone has suggested this before and it's probably too late in the game to even consider it but wouldn't it be nice to have a variant of coginit/cognew that starts a COG running in hub execution mode. This would let you start a new COG almost instantly without having to wait for almost 2K of data to be loaded.

    I've thought about that, too. I looked into it the other day and for some reason thought I wouldn't deal with that yet. I'll look again.
  • SeairthSeairth Posts: 2,474
    edited 2014-01-27 21:06
    David Betz wrote: »
    I'm sure someone has suggested this before and it's probably too late in the game to even consider it but wouldn't it be nice to have a variant of coginit/cognew that starts a COG running in hub execution mode. This would let you start a new COG almost instantly without having to wait for almost 2K of data to be loaded.

    Or, you could just have the GOGINIT/COGNEW work this way altogether. If you still wanted to load instructions to cog memory, it'd take only a few lines of code to do a bulk-copy-then-jump routine, but with much more control (like not loading all $1F3 registers or "starting" at a non-zero address).
  • roglohrogloh Posts: 5,837
    edited 2014-01-27 21:27
    David Betz wrote: »
    I'm sure someone has suggested this before and it's probably too late in the game to even consider it but wouldn't it be nice to have a variant of coginit/cognew that starts a COG running in hub execution mode. This would let you start a new COG almost instantly without having to wait for almost 2K of data to be loaded.

    This could get very useful. With such a capability, I can envisage a model where COG(s) could be quickly directed by another COG to go compute a bunch of data and maintain up to $1F4 longs worth of state internally (plus potentially 256 extra in AUX ram). In this way it could be used dynamically to pass a reasonably large amount of information from one hub exec procedure to another. I can see it might come in rather useful for parallel processing, signal processing, rendering line buffers etc where you don't want to necessarily incur the delay of reading/writing lots of hub RAM data each time you enter your procedure as you spawn each COGs workload on the fly. It would probably be less useful for static applications where each COG is only started once, but for more dynamic applications it could be very useful.

    It would be great to not have to clobber the COG RAM and be able to quickly do a COGINIT in hub mode.

    Roger
  • pedwardpedward Posts: 1,642
    edited 2014-01-27 21:31
    cgracey wrote: »
    I've thought about that, too. I looked into it the other day and for some reason thought I wouldn't deal with that yet. I'll look again.

    Chip, to do this, just copy 8 longs from HUB into the COG at $0, then start executing at $0 -- these 8 instructions would have the bootstrap code.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-01-27 22:15
    Another fpga code. Good grief! I have not had time yet to load the first one ;) Fantastic work Chip :)

    COG START...
    Yes, it might make more sense to start in hubexec mode.

    We could have a small piece of boot code in hub ROM (equal/above $00800 ($200 long) hub) that would load the cog with a variable amount of hub code.
    Basically we would run this with an address where the hub start address, length, and hub parameter address resides (or the first hub parameter is the length). This would be a simple mechanism.

    As has been said, cog ram would no longer need to be loaded, so we could hold code there between coginits, or some other info. I could see this opening up a whole lot of other opportunities for fast code tricks.

    There would be some delay for cog start to clear the appropriate registers etc, but way less than 1017 clocks. Worth more discussion me thinks ;)
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-01-28 01:18
    Here is the latest instruction set summary (reformatted).
    (Hopefully this is ok as I am using a spreadsheet with formulae developed from the previous instruction sets)
    Tip: Reduce scale in IE10 by Ctl-ScrollWheel
    -------------------------------------------------------------------------------------------------------------------------------------------------
    ZCxS Opcode  ZC I Cond  Dest       Source     Instr00 01      10      11        Operand(s)                                              Flags
    -------------------------------------------------------------------------------------------------------------------------------------------------
    ZCWS 00000ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  RDBYTE  RDBYTEC RDWORD  RDWORDC   D,S/PTRA/PTRB                                           [WZ],[WC]
    ZCWS 00001ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  RDLONG  RDLONGC RDAUX   RDAUXR    D,S/PTRA/PTRB || D,S/#0..$FF/PTRX/PTRY                  [WZ],[WC]
    ZCMS 00010ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  ISOB    NOTB    CLRB    SETB      D,S/#                                                   [WZ],[WC]
    ZCMS 00011ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  SETBC   SETBNC  SETBZ   SETBNZ    D,S/#                                                   [WZ],[WC]
    ZCMS 00100ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  ANDN    AND     OR      XOR       D,S/#                                                   [WZ],[WC]
    ZCMS 00101ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  MUXC    MUXNC   MUXZ    MUXNZ     D,S/#                                                   [WZ],[WC]
    ZCMS 00110ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  ROR     ROL     SHR     SHL       D,S/#                                                   [WZ],[WC]
    ZCMS 00111ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  RCR     RCL     SAR     REV       D,S/#                                                   [WZ],[WC]
    ZCWS 01000ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  MOV     NOT     ABS     NEG       D,S/#                                                   [WZ],[WC]
    ZCWS 01001ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  NEGC    NEGNC   NEGZ    NEGNZ     D,S/#                                                   [WZ],[WC]
    ZCMS 01010ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  ADD     SUB     ADDX    SUBX      D,S/#                                                   [WZ],[WC]
    ZCMS 01011ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  ADDS    SUBS    ADDSX   SUBSX     D,S/#                                                   [WZ],[WC]
    ZCMS 01100ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  SUMC    SUMNC   SUMZ    SUMNZ     D,S/#                                                   [WZ],[WC]
    ZCMS 01101ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  MIN     MAX     MINS    MAXS      D,S/#                                                   [WZ],[WC]
    ZCMS 01110ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  ADDABS  SUBABS  INCMOD  DECMOD    D,S/#                                                   [WZ],[WC]
    ZCMS 01111ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  CMPSUB  SUBR    MUL     SCL       D,S/#                                                   [WZ],[WC]
    ZCWS 10000ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  DECOD2  DECOD3  DECOD4  DECOD5    D,S/#                                                   [WZ],[WC]
    -------------------------------------------------------------------------------------------------------------------------------------------------
    Z-WS 100010f Zf I CCCC  DDDDDDDDD  SSSSSSSSS  ENCOD   BLMASK  ONECNT  ZERCNT    D,S/#                                                   [WZ]
    -CWS 1000110 fC I CCCC  DDDDDDDDD  SSSSSSSSS  INCPAT          DECPAT            D,S/#                                                        [WC]
    --WS 1000111 ff I CCCC  DDDDDDDDD  SSSSSSSSS  SPLITB  MERGEB  SPLITW  MERGEW    D,S/#                                                   
    --MS 10010nn nf I CCCC  DDDDDDDDD  SSSSSSSSS  GETNIB  SETNIB                    D,S/#,#0..7                                             
    --MS 1001100 nf I CCCC  DDDDDDDDD  SSSSSSSSS  GETWORD SETWORD                   D,S/#,#0..1                                             
    --MS 1001101 ff I CCCC  DDDDDDDDD  SSSSSSSSS  SETWRDS ROLNIB  ROLBYTE ROLWORD   D,S/#                                                   
    --MS 1001110 ff I CCCC  DDDDDDDDD  SSSSSSSSS  SETS    SETD    SETX    SETI      D,S/#                                                   
    -CMS 1001111 fC I CCCC  DDDDDDDDD  SSSSSSSSS  COGNEW          WAITCNT           D,S/#                                                        [WC]
    --MS 101000n nf I CCCC  DDDDDDDDD  SSSSSSSSS  GETBYTE SETBYTE                   D,S/#,#0..3                                             
    --WS 1010010 ff I CCCC  DDDDDDDDD  SSSSSSSSS  SETBYTS MOVBYTS PACKRGB UNPKRGB   D,S/#                                                   
    --MS 1010011 ff I CCCC  DDDDDDDDD  SSSSSSSSS  ADDPIX  MULPIX  BLNPIX  MIXPIX    D,S/#                                                   
    ZCMS 101010f ZC I CCCC  DDDDDDDDD  SSSSSSSSS  JMPSW   JMPSWD                    D,S/@                                                   [WZ],[WC]
    --MS 1010110 ff I CCCC  DDDDDDDDD  SSSSSSSSS  IJZ     IJZD    IJNZ    IJNZD     D,S/@                                                   
    --MS 1010111 ff I CCCC  DDDDDDDDD  SSSSSSSSS  DJZ     DJZD    DJNZ    DJNZD     D,S/@                                                   
    ZCRS 10110ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  TESTB   TESTN   TEST    CMP       D,S/#                                                   [WZ],[WC]
    ZCRS 10111ff ZC I CCCC  DDDDDDDDD  SSSSSSSSS  CMPX    CMPS    CMPSX   CMPR      D,S/#                                                   [WZ],[WC]
    --RS 11000nn nf I CCCC  DDDDDDDDD  SSSSSSSSS  COGINIT WAITVID         WAITVID   D,S/#,#0..7 | #0..$DFF,S/# || D,S/#                     
    -CRS 11001fn nC I CCCC  DDDDDDDDD  SSSSSSSSS  WAITPEQ WAITPNE                   D,S/#,#0..3                                                  [WC]
    --LS 110100f fL I CCCC  DDDDDDDDD  SSSSSSSSS  WRBYTE  WRWORD  WRLONG  FRAC      D/#,S/PTRA/PTRB ||| D/#,S/#                             
    --LS 110101f fL I CCCC  DDDDDDDDD  SSSSSSSSS  WRAUX   WRAUXR  SETACCA SETACCB   D/#,S/#0..$FF/PTRX/PTRY || D/#,S/#                      
    --LS 110110f fL I CCCC  DDDDDDDDD  SSSSSSSSS  MACA    MACB    MUL32   MUL32U    D/#,S/#                                                 
    --LS 110111f fL I CCCC  DDDDDDDDD  SSSSSSSSS  DIV32   DIV32U  DIV64   DIV64U    D/#,S/#                                                 
    --LS 111000f fL I CCCC  DDDDDDDDD  SSSSSSSSS  SQRT64  QSINCOS QARCTAN QROTATE   D/#,S/#                                                 
    --LS 111001f fL I CCCC  DDDDDDDDD  SSSSSSSSS  SETSERA SETSERB SETCTRS SETWAVS   D/#,S/#                                                 
    --LS 111010f fL I CCCC  DDDDDDDDD  SSSSSSSSS  SETFRQS SETPHSS ADDPHSS SUBPHSS   D/#,S/#                                                 
    --LS 111011f fL I CCCC  DDDDDDDDD  SSSSSSSSS  JP      JPD     JNP     JNPD      D/#,S/@                                                 
    --LS 111100n nL I CCCC  DDDDDDDDD  SSSSSSSSS  CFGPINS cfgpins cfgpins JMPTASK   D/#,S/#,#0..2 | D/#,S/#                                 
    --LS 111101f fL I CCCC  DDDDDDDDD  SSSSSSSSS  SETXFR  SETMIX                    D/#,S/#                                                 
    --RS 1111011 ff I CCCC  DDDDDDDDD  SSSSSSSSS  JZ      JZD     JNZ     JNZD      D,S/@                                                   
    --WS 1111100 ff I CCCC  DDDDDDDDD  SSSSSSSSS  LOCBASE LOCBYTE LOCWORD LOCLONG   D,S/@                                                   
    -------------------------------------------------------------------------------------------------------------------------------------------------
    ---- 1111101 10 n nnnn  nnnnnnnnn  nnnnnnnnn  AUGS                              #23bits                                                 
    ---- 1111101 11 n nnnn  nnnnnnnnn  nnnnnnnnn  AUGD                              #23bits                                                 
    ---- 1111110 [COLOR=#ff0000]00[/COLOR] 0 nnnn  nnnnnnnnn  nnniiiiii  REPS                              #1..$10000,#1..64                                       
    ---- 1111110[COLOR=#ff0000] 00 [/COLOR]1 BBAA  ddddddddd  sssssssss  xxxINDx                           FIXINDx #d,#s | #d,#s | #d,#s | SETINDx #s | #d | #d,#s 
    ---- 1111110 01 0 CCCC  ffnnnnnnn  nnnnnnnnn  JMP     JMP     JMPD    JMPD      #abs | @rel | #abs | @rel                               
    ---- 1111110 01 1 CCCC  ffnnnnnnn  nnnnnnnnn  CALL    CALL    CALLD   CALLD     #abs | @rel | #abs | @rel                               
    ---- 1111110 10 0 CCCC  ffnnnnnnn  nnnnnnnnn  CALLA   CALLA   CALLAD  CALLAD    #abs | @rel | #abs | @rel                               
    ---- 1111110 10 1 CCCC  ffnnnnnnn  nnnnnnnnn  CALLB   CALLB   CALLBD  CALLBD    #abs | @rel | #abs | @rel                               
    ---- 1111110 11 0 CCCC  ffnnnnnnn  nnnnnnnnn  CALLX   CALLX   CALLXD  CALLXD    #abs | @rel | #abs | @rel                               
    ---- 1111110 11 1 CCCC  ffnnnnnnn  nnnnnnnnn  CALLY   CALLY   CALLYD  CALLYD    #abs | @rel | #abs | @rel                               
    -------------------------------------------------------------------------------------------------------------------------------------------------
    ZCW- 1111111 ZC 0 CCCC  DDDDDDDDD  0000000ff  COGID   TASKID  LOCKNEW GETLFSR   D                                                       [WZ],[WC]
    ZCW- 1111111 ZC 0 CCCC  DDDDDDDDD  0000001ff  GETCNT  GETCNTX GETACAL GETACAH   D                                                       [WZ],[WC]
    ZCW- 1111111 ZC 0 CCCC  DDDDDDDDD  0000010ff  GETACBL GETACBH GETPTRA GETPTRB   D                                                       [WZ],[WC]
    ZCW- 1111111 ZC 0 CCCC  DDDDDDDDD  0000011ff  GETPTRX GETPTRY SERINA  SERINB    D                                                       [WZ],[WC]
    ZCW- 1111111 ZC 0 CCCC  DDDDDDDDD  0000100ff  GETMULL GETMULH GETDIVQ GETDIVR   D                                                       [WZ],[WC]
    ZCW- 1111111 ZC 0 CCCC  DDDDDDDDD  0000101ff  GETSQRT GETQX   GETQY   GETQZ     D                                                       [WZ],[WC]
    ZCW- 1111111 ZC 0 CCCC  DDDDDDDDD  0000110ff  GETPHSA GETPHZA GETCOSA GETSINA   D                                                       [WZ],[WC]
    ZCW- 1111111 ZC 0 CCCC  DDDDDDDDD  0000111ff  GETPHSB GETPHZB GETCOSB GETSINB   D                                                       [WZ],[WC]
    ZCM- 1111111 ZC 0 CCCC  DDDDDDDDD  0001000ff  PUSHZC  POPZC   SUBCNT  GETPIX    D                                                       [WZ],[WC]
    ZCM- 1111111 ZC 0 CCCC  DDDDDDDDD  0001001ff  BINBCD  BCDBIN  BINGRY  GRYBIN    D                                                       [WZ],[WC]
    ZCM- 1111111 ZC 0 CCCC  DDDDDDDDD  0001010ff  ESWAP4  ESWAP8  SEUSSF  SEUSSR    D                                                       [WZ],[WC]
    Z-M- 1111111 ZC 0 CCCC  DDDDDDDDD  0001011ff  INCD    DECD    INCDS   DECDS     D                                                       [WZ],[WC]
    ZCW- 1111111 ZC 0 CCCC  DDDDDDDDD  000110000  POP                               D                                                       [WZ],[WC]
    --L- 1111111 00 L CCCC  DDDDDDDDD  001iiiiii  REPD                              D/#1..512,#1..64                                        
    --L- 1111111 00 L CCCC  DDDDDDDDD  0100000ff  CLKSET  COGSTOP LOCKSET LOCKCLR   D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0100001ff  LOCKRET RDWIDEC RDWIDE  WRWIDE    D/# | D/PTRA/PTRB                                       
    ZCL- 1111111 ZC L CCCC  DDDDDDDDD  0100010ff  GETP    GETNP   SEROUTA SEROUTB   D/#                                                     [WZ],[WC]
    -CL- 1111111 0C L CCCC  DDDDDDDDD  0100011ff  CMPCNT  WAITPX  WAITPR  WAITPF    D/#                                                          [WC]
    ZCL- 1111111 ZC L CCCC  DDDDDDDDD  0100100ff  SETZC   SETMAP  SETXCH  SETTASK   D/#                                                     [WZ],[WC]
    --L- 1111111 00 L CCCC  DDDDDDDDD  0100101ff  SETRACE SARACCA SARACCB SARACCS   D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0100110ff  SETPTRA SETPTRB ADDPTRA ADDPTRB   D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0100111ff  SUBPTRA SUBPTRB SETWIDE SETWIDZ   D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0101000ff  SETPTRX SETPTRY ADDPTRX ADDPTRY   D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0101001ff  SUBPTRX SUBPTRY PASSCNT WAIT      D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0101010ff  OFFP    NOTP    CLRP    SETP      D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0101011ff  SETPC   SETPNC  SETPZ   SETPNZ    D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0101100ff  DIV64D  SQRT32  QLOG    QEXP      D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0101101ff  SETQI   SETQZ   CFGDACS SETDACS   D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0101110ff  CFGDAC0 CFGDAC1 CFGDAC2 CFGDAC3   D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0101111ff  SETDAC0 SETDAC1 SETDAC2 SETDAC3   D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0110000ff  SETCTRA SETWAVA SETFRQA SETPHSA   D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0110001ff  ADDPHSA SUBPHSA SETVID  SETVIDY   D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0110010ff  SETCTRB SETWAVB SETFRQB SETPHSB   D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0110011ff  ADDPHSB SUBPHSB SETVIDI SETVIDQ   D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0110100ff  SETPIX  SETPIXZ SETPIXU SETPIXV   D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0110101ff  SETPIXA SETPIXR SETPIXG SETPIXB   D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  0110110ff  SETPORA SETPORB SETPORC SETPORD   D/#                                                     
    --L- 1111111 00 L CCCC  DDDDDDDDD  011011100  PUSH                              D/#                                                     
    --R- 1111111 00 0 CCCC  DDDDDDDDD  0111101ff  JMP     JMPD    CALL    CALLD     D                                                       
    --R- 1111111 00 0 CCCC  DDDDDDDDD  0111110ff  CALLA   CALLAD  CALLB   CALLBD    D                                                       
    --R- 1111111 00 0 CCCC  DDDDDDDDD  0111111ff  CALLX   CALLXD  CALLY   CALLYD    D                                                       
    ZC-- 1111111 ZC x CCCC  xxxxxxxxx  1000000ff  RETA    RETAD   RETB    RETBD                                                             [WZ],[WC]
    ZC-- 1111111 ZC x CCCC  xxxxxxxxx  1000001ff  RETX    RETXD   RETY    RETYD                                                             [WZ],[WC]
    ZC-- 1111111 ZC x CCCC  xxxxxxxxx  1000010ff  RET     RETD    POLCTRA POLCTRB                                                           [WZ],[WC]
    ZC-- 1111111 ZC x CCCC  xxxxxxxxx  1000011ff  POLVID  CAPCTRA CAPCTRB CAPCTRS                                                           [WZ],[WC]
    ---- 1111111 00 x CCCC  xxxxxxxxx  1000100ff  SETPIXW CLRACCA CLRACCB CLRACCS                                                           
    ZC-- 1111111 ZC x CCCC  xxxxxxxxx  1000101ff  CHKPTRX CHKPTRY SYNCTRA SYNCTRB                                                           [WZ],[WC]
    ---- 1111111 00 x CCCC  xxxxxxxxx  1000110ff  DCACHEX ICACHEX ICACHEP ICACHEN                                                           
    -------------------------------------------------------------------------------------------------------------------------------------------------
    
    InstructionSet_20140126.spin
    There are two errors in this file "ff" s/be "00" for REPS and FIXINDx/SETINDx (see red in above code)
  • evanhevanh Posts: 16,031
    edited 2014-01-28 02:06
    David Betz wrote: »
    I'm sure someone has suggested this before and it's probably too late in the game to even consider it but wouldn't it be nice to have a variant of coginit/cognew that starts a COG running in hub execution mode. This would let you start a new COG almost instantly without having to wait for almost 2K of data to be loaded.

    The matter has been broached in the past :) - http://forums.parallax.com/showthread.php/152079-Hub-Execution-Model-Thread-(split-from-blog)?p=1226871&viewfull=1#post1226871
  • cgraceycgracey Posts: 14,206
    edited 2014-01-28 07:31
    I just updated the .zip file in the first post.

    LOCTPTRA/LOCPTRB were added and the Prop2_Docs.txt was updated. Note that you now must precede any cog-resident code with ORG, as ORGH is the default mode at the beginning of every DAT block.
  • cgraceycgracey Posts: 14,206
    edited 2014-01-28 07:33
    evanh wrote: »


    Those have changed, and have been updated in the latest .zip file. Thanks for finding these things. The newest Pro2_Docs.txt has all the fixes you found, plus some others.
  • Bill HenningBill Henning Posts: 6,445
    edited 2014-01-28 09:00
    Thanks Chip!

    I can't wait to get the RoboPi docs done so I can play... heck, I'll probably play once the text is done, before I take the build pics :)
    cgracey wrote: »
    I just updated the .zip file in the first post.

    LOCTPTRA/LOCPTRB were added and the Prop2_Docs.txt was updated. Note that you now must precede any cog-resident code with ORG, as ORGH is the default mode at the beginning of every DAT block.
  • rjo__rjo__ Posts: 2,114
    edited 2014-01-28 10:18
    I have no fears. The nice thing about all the advanced features is that you only have to use them when you need them… and
    when you need them, they make sense. The rest of the time, the Prop2 is just a Prop1 on steroids:)
Sign In or Register to comment.