Shop OBEX P1 Docs P2 Docs Learn Events
P1 Instruction Set Summary — Parallax Forums

P1 Instruction Set Summary

Cluso99Cluso99 Posts: 18,069
edited 2016-07-01 04:04 in Propeller 1
While I was doing the P2 Instruction Set Summary I thought I may as well do one for the P1. (not sure if I have done this before)

Postedit: corrected errors from following post. Added color pic.
P1 Instruction Summary 
---------------------------------------------------------------------------------------------------
Opcode ZC R I Cond Dest       Source     Instr00 01      10      11        Operand(s)   Flags
---------------------------------------------------------------------------------------------------
0000ff -- 0 I CCCC DDDDDDDDD  SSSSSSSSS  WRBYTE  WRWORD  WRLONG            D,S/#        -- -- --    
 "  "  Z- 1 I CCCC DDDDDDDDD  SSSSSSSSS  RDBYTE  RDWORD  RDLONG            D,S/#        Z- Z- Z-    
 "  11 ZC R 1 CCCC DDDDDDDDD  ------0ff  CLKSET  COGID   COGINIT COGSTOP   D            ZC ZC ZC ZC (HUBOP)
 "  11 ZC R 1 CCCC DDDDDDDDD  ------1ff  LOCKNEW LOCKRET LOCKSET LOCKCLR   D            ZC ZC ZC ZC (HUBOP)
0001ff Z- R I CCCC DDDDDDDDD  SSSSSSSSS  **MUL   **MULS  **ENC   **ONES    D,S/#        Z- Z- Z- Z- 
0010ff ZC R I CCCC DDDDDDDDD  SSSSSSSSS  ROR     ROL     SHR     SHL       D,S/#        ZC ZC ZC ZC 
0011ff ZC R I CCCC DDDDDDDDD  SSSSSSSSS  RCR     RCL     SAR     REV       D,S/#        ZC ZC ZC ZC 
0100ff ZC R I CCCC DDDDDDDDD  SSSSSSSSS  MINS    MAXS    MIN     MAX       D,S/#        ZC ZC ZC ZC 
0101ff Z- R I CCCC DDDDDDDDD  SSSSSSSSS  MOVS    MOVD    MOVI    JMPRET    D,S/#        Z- Z- Z- Z- 
 "  11 Z- 0 I CCCC ---------  SSSSSSSSS                          JMP       S/#                   Z-          
 "  11 Z- 0 1 CCCC ---------  <retaddr>                          RET                             Z-          
 "  11 Z- 1 I CCCC <addrptr>  SSSSSSSSS                          CALL      S/#                   Z-          
0110ff ZC R I CCCC DDDDDDDDD  SSSSSSSSS  AND     ANDN    OR      XOR       D,S/#        ZC ZC ZC ZC 
 "  0f ZC 0 I CCCC DDDDDDDDD  SSSSSSSSS  TEST    TESTN                     D,S/#        ZC ZC       
0111ff ZC R I CCCC DDDDDDDDD  SSSSSSSSS  MUXC    MUXNC   MUXZ    MUXNZ     D,S/#        ZC ZC ZC ZC 
1000ff ZC R I CCCC DDDDDDDDD  SSSSSSSSS  ADD     SUB     ADDABS  SUBABS    D,S/#        ZC ZC ZC ZC 
 "  01 ZC 0 I CCCC DDDDDDDDD  SSSSSSSSS          CMP                       D,S/#           ZC          
1001ff ZC R I CCCC DDDDDDDDD  SSSSSSSSS  SUMC    SUMNC   SUMZ    SUMNZ     D,S/#        ZC ZC ZC ZC 
1010ff ZC R I CCCC DDDDDDDDD  SSSSSSSSS  MOV     NEG     ABS     ABSNEG    D,S/#        ZC ZC ZC ZC 
1011ff ZC R I CCCC DDDDDDDDD  SSSSSSSSS  NEGC    NEGNC   NEGZ    NEGNZ     D,S/#        ZC ZC ZC ZC 
1100ff ZC R I CCCC DDDDDDDDD  SSSSSSSSS  CMPS    CMPSX   ADDX    SUBX      D,S/#        ZC ZC ZC ZC 
 "  11 ZC 0 I CCCC DDDDDDDDD  SSSSSSSSS                          CMPX      D,S/#                 ZC          
1101ff ZC R I CCCC DDDDDDDDD  SSSSSSSSS  ADDS    SUBS    ADDSX   SUBSX     D,S/#        ZC ZC ZC ZC 
1110ff ZC R I CCCC DDDDDDDDD  SSSSSSSSS  CMPSUB  DJNZ    TJNZ    TJZ       D,S/#        ZC ZC ZC ZC 
1111ff -C R I CCCC DDDDDDDDD  SSSSSSSSS  WAITPEQ WAITPNE WAITCNT WAITVID   D,S/#        -C -- -C -- 
------ -- - - 0000 ---------  ---------  NOP                                            --          
---------------------------------------------------------------------------------------------------
** = Not Implemented
P1%20Instruction%20Summary.jpg
860 x 550 - 264K

Comments

  • There are several errors in your instruction summary. CMP is just a SUB NR, similarly to how TEST and TESTN are just AND NR and ANDN NR . You have ADDABS where SUBABS should be, and you have CMP where ADDABS should be. You say that the R bit for ADDX and SUBX is always 0, because they're in the same group as CMPS and CMPSX (for which the R bit is always 0), which is certainly not true. Also, you say that the R bit for the WAITxxx instructions is always 0, but for all four of them, setting it to 1 causes it to do dest += src (this is mainly for WAITCNT, but it works for all of them). You do the same thing for COGINIT - you need to set R to 1 to figure out what cog was started in a cognew.
  • Cluso99Cluso99 Posts: 18,069
    edited 2016-07-01 01:55
    Electrodude,
    Thanks for finding errors. I will update the first post with corrections shortly done.
    There were some shortcomings with my spreadsheet which automatically does a lot of this work for me (for the P2).
  • Cluso99Cluso99 Posts: 18,069
    Updated first post again.
Sign In or Register to comment.