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

HUB EXEC Update Here

1356716

Comments

  • SapiehaSapieha Posts: 2,964
    edited 2014-01-28 10:30
    Hi Chip.

    I think it is bug in this last info You posted

    
                                                                    I think need be     <[COLOR=#ff0000]Y[/COLOR]>
    1111110 11 1 CCCC 00 nnnnnnnnnnnnnnnn     CALLY   #n         'write Z,C,PC* into [PTR[COLOR=#ff0000]X[/COLOR]++], PC=n   4 **
    1111110 11 1 CCCC 01 nnnnnnnnnnnnnnnn     CALLY   @n         'write Z,C,PC* into [PTR[COLOR=#ff0000]X[/COLOR]++], PC+=n  4 **
    1111110 11 1 CCCC 10 nnnnnnnnnnnnnnnn     CALLYD  #n         'write Z,C,PC* into [PTR[COLOR=#ff0000]X[/COLOR]++], PC=n   4 **
    1111110 11 1 CCCC 11 nnnnnnnnnnnnnnnn     CALLYD  @n         'write Z,C,PC* into [PTR[COLOR=#ff0000]X[/COLOR]++], PC+=n  4 **
    
    
    
    
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-01-28 16:21
    Chip,
    I noted in the updated docs that Pin Transfer (wide to pins) only transfers 4 longs (not 8). Is this correct?
    (Lines 2656+ and 2669+)
  • User NameUser Name Posts: 1,451
    edited 2014-01-28 16:23
    @Chip:

    I really like how you've done Prop2_Docs! Even if a more verbose manual gets written someday, or if an ultra-terse quick reference guide is produced, I hope that this bridge between the two will continue to be supported and preserved.

    It would take too long to explain this instant love affair in detail. So I'll just say that it's perfect.

    Thank you!
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-01-28 21:33
    Here is the latest P2 Instruction Set summary (Jan 28th)...
    (please note not all condition modifiers WZ and WC are correct for all instructions per line)
    -------------------------------------------------------------------------------------------------------------------------------------------------
    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 1010100 ZC I CCCC  DDDDDDDDD  SSSSSSSSS  JMPSW                             D,S/@                                                        [WZ],[WC]
    ZCMS 1010101 ZC I CCCC  DDDDDDDDD  SSSSSSSSS  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 WAITVID   D,S/#,#0..7                                                  
    -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                                      
    --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                           D/#,S/#,#0..2                                                
    --LS 1111001 1L I CCCC  DDDDDDDDD  SSSSSSSSS  JMPTASK                           D/#,S/#                                                      
    --LS 1111010 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/@                                                        
    --RS 1111101 ff I CCCC  DDDDDDDDD  SSSSSSSSS  JMPLIST LOCINST AUGS    AUGD      D,S/@ | #23bits                                              
    -------------------------------------------------------------------------------------------------------------------------------------------------
    ---- 1111101 01 1 nnnn  nnnnnnnnn  nnniiiiii  REPS                              #1..$10000,#1..64                                            
    -------------------------------------------------------------------------------------------------------------------------------------------------
    ---- 1111110 ff 0 BBAA  ddddddddd  sssssssss  FIX/SET-INDA/INDB/INDS            #d,#s / FIXINDB #d,#s / FIXINDS #d,#s / SETINDA #s / SETINDB 
    ---- 1111110 00 1 CCCC  ffnnnnnnn  nnnnnnnnn  LOCPTRA LOCPTRA LOCPTRB LOCPTRB   #abs | @rel                                                  
    ---- 1111110 01 0 CCCC  ffnnnnnnn  nnnnnnnnn  JMP     JMP     JMPD    JMPD      #abs | @rel                                                  
    ---- 1111110 01 1 CCCC  ffnnnnnnn  nnnnnnnnn  CALL    CALL    CALLD   CALLD     #abs | @rel                                                  
    ---- 1111110 10 0 CCCC  ffnnnnnnn  nnnnnnnnn  CALLA   CALLA   CALLAD  CALLAD    #abs | @rel                                                  
    ---- 1111110 10 1 CCCC  ffnnnnnnn  nnnnnnnnn  CALLB   CALLB   CALLBD  CALLBD    #abs | @rel                                                  
    ---- 1111110 11 0 CCCC  ffnnnnnnn  nnnnnnnnn  CALLX   CALLX   CALLXD  CALLXD    #abs | @rel                                                  
    ---- 1111110 11 1 CCCC  ffnnnnnnn  nnnnnnnnn  CALLY   CALLY   CALLYD  CALLYD    #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  0001100ff  POP                               D                                                            [WZ],[WC]
    -------------------------------------------------------------------------------------------------------------------------------------------------
    --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  0110111ff  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_20140128.spin
  • roglohrogloh Posts: 5,837
    edited 2014-01-28 22:01
    @Cluso99,

    Is there a collision in your P2 instruction set summary document for the following two instructions groups or am I just reading it wrong? Something doesn't seem right here.

    --RS 1111101 ff I CCCC  DDDDDDDDD  SSSSSSSSS  JMPLIST LOCINST AUGS    AUGD      D,S/@ | #23bits                                              
    -------------------------------------------------------------------------------------------------------------------------------------------------
    ---- 1111101 01 1 nnnn  nnnnnnnnn  nnniiiiii  REPS                              #1..$10000,#1..64                                            
    


    UPDATE: Never mind, I went to Chip's latest docs and see that the I bit has to be a 0 for LOCINST (only) and a 1 for REPS even though both instructions use the exact same 01 pattern in the two ff bits. This was just not readily apparent in the summary document which had temporarily confused me.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-01-29 00:30
    rogloh wrote: »
    @Cluso99,

    Is there a collision in your P2 instruction set summary document for the following two instructions groups or am I just reading it wrong? Something doesn't seem right here.

    --RS 1111101 ff I CCCC  DDDDDDDDD  SSSSSSSSS  JMPLIST LOCINST AUGS    AUGD      D,S/@ | #23bits                                              
    -------------------------------------------------------------------------------------------------------------------------------------------------
    ---- 1111101 01 1 nnnn  nnnnnnnnn  nnniiiiii  REPS                              #1..$10000,#1..64                                            
    


    UPDATE: Never mind, I went to Chip's latest docs and see that the I bit has to be a 0 for LOCINST (only) and a 1 for REPS even though both instructions use the exact same 01 pattern in the two ff bits. This was just not readily apparent in the summary document which had temporarily confused me.
    Yes, there are a couple of places where the overlap has to be inspected closely to see what is really happening - Chips tricks ;)
    The push and pop instructions actually only use 1 of the block of 4 and the other 3 are free.
  • cgraceycgracey Posts: 14,206
    edited 2014-01-29 01:44
    Cluso99 wrote: »
    Chip,
    I noted in the updated docs that Pin Transfer (wide to pins) only transfers 4 longs (not 8). Is this correct?
    (Lines 2656+ and 2669+)


    Cluso99, if you look in the latest .zip file, I got this straightened out. It uses all eight WIDE registers. I had to add a bit to the XFR counter.
  • cgraceycgracey Posts: 14,206
    edited 2014-01-29 01:46
    User Name wrote: »
    @Chip:

    I really like how you've done Prop2_Docs! Even if a more verbose manual gets written someday, or if an ultra-terse quick reference guide is produced, I hope that this bridge between the two will continue to be supported and preserved.

    It would take too long to explain this instant love affair in detail. So I'll just say that it's perfect.

    Thank you!


    That makes me feel relieved, because I try to write them so they get the point across with brevity, so things don't get lost. They are insufficient in some regards, but that will get fixed a little later.
  • evanhevanh Posts: 16,032
    edited 2014-01-29 01:55
    cgracey 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.

    Ah what? That doesn't compute to what I was linking. Chip, I think you might have replied to the wrong person. I was replying to David about allowing COGINIT to start a Cog directly to HubExec mode without any pre-loading of the Cog.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-01-29 01:57
    cgracey wrote: »
    Cluso99, if you look in the latest .zip file, I got this straightened out. It uses all eight WIDE registers. I had to add a bit to the XFR counter.
    Chip, this is from the latest docs (28th). It is the wide to pins direction - the two examples show only 4 longs are transferred either as 4 longs or 8 words, not 8 or 16.

    BTW The P2 is looking amazing now. I cannot believe how much the P2 has advanced since Thanksgiving! You have really done a magnificent job!
  • ozpropdevozpropdev Posts: 2,793
    edited 2014-01-29 02:12
    Line #1173 in docs typo
    loop2           DJNZD   X,[color=red]#[/color]loop2        'loop, delayed branch executes 3 trailing instructions
    
  • evanhevanh Posts: 16,032
    edited 2014-01-29 02:20
    A hash exists on line 1173 in the latest version for me.
  • ozpropdevozpropdev Posts: 2,793
    edited 2014-01-29 02:24
    evanh wrote: »
    A hash exists on line 1173 in the latest version for me.

    It is supposed to be @

    DJNZ/DJNZD are now relative jumps.
  • evanhevanh Posts: 16,032
    edited 2014-01-29 02:25
    Ah, right. :)
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-01-29 03:30
    There were a couple of errors in the Insruction Summary posted above, so here is an update...
    (flags are not correct for some instructions on the same line)
    InstructionSet 2014/01/28
    ----------------------------------------------------------------------------------------------------------------------------------
    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 1010100 ZC I CCCC  DDDDDDDDD  SSSSSSSSS  JMPSW                             D,S/@                                    [WZ],[WC]
    ZCMS 1010101 ZC I CCCC  DDDDDDDDD  SSSSSSSSS  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 WAITVID   D,S/#,#0..7 | #0..$DFF,S/# || D,S/#      
    -CRS 11001fn nC I CCCC  DDDDDDDDD  SSSSSSSSS  WAITPEQ 0       WAITPNE 0         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                  
    --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                           D/#,S/#,#0..2                            
    --LS 1111001 1L I CCCC  DDDDDDDDD  SSSSSSSSS  JMPTASK 0       0       0         D/#,S/#                                  
    --LS 1111010 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/@                                    
    --RS 1111101 ff I CCCC  DDDDDDDDD  SSSSSSSSS  JMPLIST LOCINST AUGS    AUGD      D,S/@ | #23bits                          
    ---- 1111101 01 1 nnnn  nnnnnnnnn  nnniiiiii  0       REPS    0       0         #1..$10000,#1..64                        
    ----------------------------------------------------------------------------------------------------------------------------------
    ---- 1111110 00 0 BBAA  ddddddddd  sssssssss  FIX/SET-0       0       0         FIX #d,#s | SET #s|#d|#d,#s              
    ---- 1111110 00 1 CCCC  ffnnnnnnn  nnnnnnnnn  LOCPTRA LOCPTRA LOCPTRB LOCPTRB   #abs | @rel                              
    ---- 1111110 01 0 CCCC  ffnnnnnnn  nnnnnnnnn  JMP     JMP     JMPD    JMPD      #abs | @rel                              
    ---- 1111110 01 1 CCCC  ffnnnnnnn  nnnnnnnnn  CALL    CALL    CALLD   CALLD     #abs | @rel                              
    ---- 1111110 10 0 CCCC  ffnnnnnnn  nnnnnnnnn  CALLA   CALLA   CALLAD  CALLAD    #abs | @rel                              
    ---- 1111110 10 1 CCCC  ffnnnnnnn  nnnnnnnnn  CALLB   CALLB   CALLBD  CALLBD    #abs | @rel                              
    ---- 1111110 11 0 CCCC  ffnnnnnnn  nnnnnnnnn  CALLX   CALLX   CALLXD  CALLXD    #abs | @rel                              
    ---- 1111110 11 1 CCCC  ffnnnnnnn  nnnnnnnnn  CALLY   CALLY   CALLYD  CALLYD    #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  0001100ff  POP     <empty> <empty> <empty>   D                                        [WZ],[WC]
    ----------------------------------------------------------------------------------------------------------------------------------
    --L- 1111111 00 L CCCC  DDDDDDDDD  001iiiiii  REPD    0       0       0         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  0110111ff  PUSH    <empty> <empty> <empty>   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_20140128c.spin
  • wmosscropwmosscrop Posts: 409
    edited 2014-01-29 11:02
    Please pardon me if this topic was already discussed...

    Are there any provisions for handling quotient overflows from a 64/32 bit divide?

    For example, if I divide 2^33 by 1, what will GETDIVQ return? Will carry be set?

    Walter
  • evanhevanh Posts: 16,032
    edited 2014-01-29 13:13
    wmosscrop wrote: »
    Are there any provisions for handling quotient overflows from a 64/32 bit divide?

    For example, if I divide 2^33 by 1, what will GETDIVQ return? Will carry be set?

    I think would have to pre-bit-shift the denominator to be larger than the upper 32 bits of numerator. Eg: The 1 becomes 4.

    Hmm, has the ring of floating-point to it ...
  • cgraceycgracey Posts: 14,206
    edited 2014-01-30 07:10
    wmosscrop wrote: »
    Please pardon me if this topic was already discussed...

    Are there any provisions for handling quotient overflows from a 64/32 bit divide?

    For example, if I divide 2^33 by 1, what will GETDIVQ return? Will carry be set?

    Walter


    No. I need to figure out what happens and document it. I think you might get $FFFFFFFF.
  • cgraceycgracey Posts: 14,206
    edited 2014-01-30 07:13
    Cluso99 wrote: »
    Chip, this is from the latest docs (28th). It is the wide to pins direction - the two examples show only 4 longs are transferred either as 4 longs or 8 words, not 8 or 16.

    BTW The P2 is looking amazing now. I cannot believe how much the P2 has advanced since Thanksgiving! You have really done a magnificent job!


    Thank you all for noticing these things. I'll review the docs today and fix all these things. I'm glad you guys understand this all well enough to notice problems like these. There are going to be phase errors as things evolve.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-01-30 07:50
    Chip, of course there are going to be errors - we are all human! It is a great credit to you that there are so few errors, and the explanations are quite clear withou being verbose.

    Now I have been thinking (dangerous I know ;) ), spin2 may as well use hubexec mode, freeing up cog ram and aux ram for variables and stack space.Here I mean the interpreter. The pasm code shouldbe able to run as reentrant code (a term used in the mini I worked on that permitted multiple processors to concurrently execute the same shared code). What I mean here is that multiple cogs can execuute the same pasm hubexec spin interppreter code concurrently without any conflicts.

    Sorry for typos - on xoom :(
  • cgraceycgracey Posts: 14,206
    edited 2014-01-30 09:15
    Cluso99 wrote: »
    ...Now I have been thinking (dangerous I know ;) ), spin2 may as well use hubexec mode, freeing up cog ram and aux ram for variables and stack space.Here I mean the interpreter. The pasm code shouldbe able to run as reentrant code (a term used in the mini I worked on that permitted multiple processors to concurrently execute the same shared code). What I mean here is that multiple cogs can execuute the same pasm hubexec spin interppreter code concurrently without any conflicts.

    Sorry for typos - on xoom :(


    Absolutely! This will free up lots of cog RAM space. We can also run four hardware threads of interpreted Spin code, per cog.
  • SeairthSeairth Posts: 2,474
    edited 2014-01-30 09:32
    cgracey wrote: »
    Absolutely! This will free up lots of cog RAM space. We can also run four hardware threads of interpreted Spin code, per cog.

    That's crazy talk!
  • jazzedjazzed Posts: 11,803
    edited 2014-01-30 09:40
    cgracey wrote: »
    Absolutely! This will free up lots of cog RAM space. We can also run four hardware threads of interpreted Spin code, per cog.

    So, a Spin2 compiler will generate byte-codes as well as HUBEXEC code?

    Byte-codes are much more compact than PASM of course and would certainly be missed if not supported.

    Watch out with that "interpreted" word. We don't want Bill getting all postal on us again :)
  • potatoheadpotatohead Posts: 10,261
    edited 2014-01-30 09:53
    Hard to imagine it won't do byte codes. Inline PASM will be there for higher speed cases.
  • cgraceycgracey Posts: 14,206
    edited 2014-01-30 11:02
    potatohead wrote: »
    Hard to imagine it won't do byte codes. Inline PASM will be there for higher speed cases.


    I was thinking that you could have Spin subroutines employ a keyword in their declaration to force real compilation for when the speed is really needed. You could even do the same at the object instantiation level, to compile everything in that object.
  • jazzedjazzed Posts: 11,803
    edited 2014-01-30 11:25
    cgracey wrote: »
    I was thinking that you could have Spin subroutines employ a keyword in their declaration to force real compilation for when the speed is really needed. You could even do the same at the object instantiation level, to compile everything in that object.
    Excellent.

    Sounds a lot like the HUBTEXT keyword in Propeller-GCC which is used to force XMM code into HUB RAM for functions that need speed such as serial IO which saves a COG.

    I assume inline PASM would be treated in a similar way.
  • potatoheadpotatohead Posts: 10,261
    edited 2014-01-30 12:39
    Excellent indeed!

    I have the same assumption / question about inline PASM
  • David BetzDavid Betz Posts: 14,516
    edited 2014-01-30 22:47
    cgracey wrote: »
    I was thinking that you could have Spin subroutines employ a keyword in their declaration to force real compilation for when the speed is really needed. You could even do the same at the object instantiation level, to compile everything in that object.
    This sounds excellent. I Spin compiler that can produce native code would be great. You get speed where you need it and code density when speed doesn't matter as much. Sounds like a good combination.
  • Dave HeinDave Hein Posts: 6,347
    edited 2014-01-31 06:48
    I recall that this idea was discussed a few years ago in connection to SpinLMM. I proposed variations of the PUB and PRI keywords that would cause the entire method to be compiled to LMM PASM instead of Spin byte codes. The PASM code would have access to cog RAM so it could use PBASE, VBASE and DBASE to access Spin variables. Of course, this could be done inline within a method as well, but the PASM code will need to be careful about how it pushes and pops stuff off of the Spin stack.
  • Dave HeinDave Hein Posts: 6,347
    edited 2014-01-31 13:17
    I found the thread that I referred to in my previous post. It's a thread from about 4 years ago at http://forums.parallax.com/showthread.php/119695-Suggestion-for-improving-Spin-performance . However, the idea there was to compile Spin code into PASM that would run in a separate cog. I suggested using the keywords CPUB, CPRI, CDAT and CVAR to generate instructions and data that would reside within a Cog. I actually began writing a compiler that would generate the PASM code. Maybe something like this could be used to generate HUB Exec code, or maybe a compiler directive would work better.
Sign In or Register to comment.