Parallax P2 Edge Module - Datasheet

PROPELLER 2 ASSEMBLY LANGUAGE (PASM2) IN BRIEF
Math and Logic Instructions
Instruction
Description
Clocks
Reg, LUT, & Hub
ABS D {WC/WZ/WCZ}
Get absolute value of D into D. D = ABS(D). C = D[31]. *
2
ABS D,{#}S {WC/WZ/WCZ}
Get absolute value of S into D. D = ABS(S). C = S[31]. *
2
ADD D,{#}S {WC/WZ/WCZ}
Add S into D. D = D + S. C = carry of (D + S). *
2
ADDS D,{#}S {WC/WZ/WCZ}
Add S into D, signed. D = D + S. C = correct sign of (D + S). *
2
ADDSX D,{#}S {WC/WZ/WCZ}
Add (S + C) into D, signed and extended. D = D + S + C. C = correct sign of (D + S + C). Z = Z AND (result == 0).
2
ADDX D,{#}S {WC/WZ/WCZ}
Add (S + C) into D, extended. D = D + S + C. C = carry of (D + S + C). Z = Z AND (result == 0).
2
AND D,{#}S {WC/WZ/WCZ}
AND S into D. D = D & S. C = parity of result. *
2
ANDN D,{#}S {WC/WZ/WCZ}
AND !S into D. D = D & !S. C = parity of result. *
2
BITC D,{#}S {WCZ}
Bits D[S[9:5]+S[4:0]:S[4:0]] = C. Other bits unaected. Prior SETQ overrides S[9:5]. C,Z = original D[S[4:0]].
2
BITH D,{#}S {WCZ}
Bits D[S[9:5]+S[4:0]:S[4:0]] = 1. Other bits unaected. Prior SETQ overrides S[9:5]. C,Z = original D[S[4:0]].
2
BITL D,{#}S {WCZ}
Bits D[S[9:5]+S[4:0]:S[4:0]] = 0. Other bits unaected. Prior SETQ overrides S[9:5]. C,Z = original D[S[4:0]].
2
BITNC D,{#}S {WCZ}
Bits D[S[9:5]+S[4:0]:S[4:0]] = !C. Other bits unaected. Prior SETQ overrides S[9:5]. C,Z = original D[S[4:0]].
2
BITNOT D,{#}S {WCZ}
Toggle bits D[S[9:5]+S[4:0]:S[4:0]]. Other bits unaected. Prior SETQ overrides S[9:5]. C,Z = original D[S[4:0]].
2
BITNZ D,{#}S {WCZ}
Bits D[S[9:5]+S[4:0]:S[4:0]] = !Z. Other bits unaected. Prior SETQ overrides S[9:5]. C,Z = original D[S[4:0]].
2
BITRND D,{#}S {WCZ}
Bits D[S[9:5]+S[4:0]:S[4:0]] = RNDs. Other bits unaected. Prior SETQ overrides S[9:5]. C,Z = original
D[S[4:0]].
2
BITZ D,{#}S {WCZ}
Bits D[S[9:5]+S[4:0]:S[4:0]] = Z. Other bits unaected. Prior SETQ overrides S[9:5]. C,Z = original D[S[4:0]].
2
BMASK D
Get LSB-justified bit mask of size (D[4:0] + 1) into D. D = ($0000_0002 << D[4:0]) - 1.
2
BMASK D,{#}S
Get LSB-justified bit mask of size (S[4:0] + 1) into D. D = ($0000_0002 << S[4:0]) - 1.
2
CMP D,{#}S {WC/WZ/WCZ}
Compare D to S. C = borrow of (D - S). Z = (D == S).
2
CMPM D,{#}S {WC/WZ/WCZ}
Compare D to S, get MSB of dierence into C. C = MSB of (D - S). Z = (D == S).
2
CMPR D,{#}S {WC/WZ/WCZ}
Compare S to D (reverse). C = borrow of (S - D). Z = (D == S).
2
CMPS D,{#}S {WC/WZ/WCZ}
Compare D to S, signed. C = correct sign of (D - S). Z = (D == S).
2
CMPSUB D,{#}S {WC/WZ/WCZ}
Compare and subtract S from D if D >= S. If D => S then D = D - S and C = 1, else D same and C = 0. *
2
CMPSX D,{#}S {WC/WZ/WCZ}
Compare D to (S + C), signed and extended. C = correct sign of (D - (S + C)). Z = Z AND (D == S + C).
2
CMPX D,{#}S {WC/WZ/WCZ}
Compare D to (S + C), extended. C = borrow of (D - (S + C)). Z = Z AND (D == S + C).
2
CRCBIT D,{#}S
Iterate CRC value in D using C and polynomial in S. If (C XOR D[0]) then D = (D >> 1) XOR S, else D = (D >> 1).
2
CRCNIB D,{#}S
Iterate CRC value in D using Q[31:28] and polynomial in S. Like CRCBIT x 4. Q = Q << 4. Use 'REP
#n,#1'+SETQ+CRCNIB+CRCNIB+CRCNIB...
2
DECMOD D,{#}S {WC/WZ/WCZ}
Decrement with modulus. If D = 0 then D = S and C = 1, else D = D - 1 and C = 0. *
2
DECOD D
Decode D[4:0] into D. D = 1 << D[4:0].
2
DECOD D,{#}S
Decode S[4:0] into D. D = 1 << S[4:0].
2
ENCOD D {WC/WZ/WCZ}
Get bit position of top-most '1' in D into D. D = position of top '1' in S (0..31). C = (S != 0). *
2
ENCOD D,{#}S {WC/WZ/WCZ}
Get bit position of top-most '1' in S into D. D = position of top '1' in S (0..31). C = (S != 0). *
2
FGE D,{#}S {WC/WZ/WCZ}
Force D >= S. If D < S then D = S and C = 1, else D same and C = 0. *
2
FGES D,{#}S {WC/WZ/WCZ}
Force D >= S, signed. If D < S then D = S and C = 1, else D same and C = 0. *
2
FLE D,{#}S {WC/WZ/WCZ}
Force D <= S. If D > S then D = S and C = 1, else D same and C = 0. *
2
FLES D,{#}S {WC/WZ/WCZ}
Force D <= S, signed. If D > S then D = S and C = 1, else D same and C = 0. *
2
GETBYTE D
Get byte established by prior ALTGB instruction into D.
2
GETBYTE D,{#}S,#N
Get byte N of S into D. D = {24'b0, S.BYTE[N]).
2
GETNIB D
Get nibble established by prior ALTGN instruction into D.
2
GETNIB D,{#}S,#N
Get nibble N of S into D. D = {28'b0, S.NIBBLE[N]).
2
GETWORD D
Get word established by prior ALTGW instruction into D.
2
GETWORD D,{#}S,#N
Get word N of S into D. D = {16'b0, S.WORD[N]).
2
INCMOD D,{#}S {WC/WZ/WCZ}
Increment with modulus. If D = S then D = 0 and C = 1, else D = D + 1 and C = 0. *
2
Copyright © Parallax Inc. 2021/05/27 Parallax Propeller 2 (P2X8C4M64P) Datasheet Page 33