docs/DSP: Hyperlink opcode names

This commit is contained in:
Pokechu22 2021-08-11 16:35:41 -07:00
parent ccc5085988
commit 16da6e214d

View file

@ -49,7 +49,7 @@
\date{\today\\v0.0.7} \date{\today\\v0.0.7}
% Title formatting commands % Title formatting commands
\newcommand{\OpcodeTitle}[1]{\subsection{\textbf{\Large #1}}} \newcommand{\OpcodeTitle}[1]{\subsection{#1}\label{instruction:#1}}
% Formatting/self-documenting commands % Formatting/self-documenting commands
\newcommand{\Address}[1]{\texttt{#1}} \newcommand{\Address}[1]{\texttt{#1}}
@ -58,7 +58,7 @@
\newcommand{\Flag}[1]{\texttt{#1}} \newcommand{\Flag}[1]{\texttt{#1}}
\newcommand{\Function}[1]{\texttt{#1}} \newcommand{\Function}[1]{\texttt{#1}}
\newcommand{\InlineExpression}[1]{\texttt{#1}} \newcommand{\InlineExpression}[1]{\texttt{#1}}
\newcommand{\Opcode}[1]{\texttt{#1}} \newcommand{\Opcode}[1]{\texttt{\nameref{instruction:#1}}}
\newcommand{\Register}[1]{\texttt{#1}} \newcommand{\Register}[1]{\texttt{#1}}
\newcommand{\RegisterField}[1]{\texttt{#1}} \newcommand{\RegisterField}[1]{\texttt{#1}}
\newcommand{\Value}[1]{\texttt{#1}} \newcommand{\Value}[1]{\texttt{#1}}
@ -1005,7 +1005,7 @@ Opcode decoding uses special naming for bits and their decimal representations t
\section{Conditional opcodes} \section{Conditional opcodes}
Conditional opcodes are executed only when the condition described by their encoded conditional field has been met. Conditional opcodes are executed only when the condition described by their encoded conditional field has been met.
The groups of conditional instructions are: \Opcode{CALL}, \Opcode{JMP}, \Opcode{IF}, and \Opcode{RET}. The groups of conditional instructions are: \Opcode{CALLcc}, \Opcode{Jcc}, \Opcode{IFcc}, and \Opcode{RETcc}.
\begin{table}[H] \begin{table}[H]
\centering \centering
@ -3750,149 +3750,178 @@ allow extending (8 lower bits of opcode not used by opcode). Extended opcodes do
\section{Instructions sorted by opcode} \section{Instructions sorted by opcode}
\newcommand{\OpcodeRow}[2]{\Opcode{#2} & \texttt{#1} & \pageref{instruction:#2} \\*}
\newcolumntype{T}{>{\ttfamily}l} \newcommand{\OpcodeRowUnk}[1]{Unknown & \texttt{#1} \\*}
\newcommand{\OpcodeRowSkip}[0]{\\}
\begin{center} \begin{center}
\begin{longtable}{TllT} \begin{longtable}{llr}
NOP & & * & 0000 0000 0000 0000 \\ Instruction & Opcode & Page \\ \hline
DAR & & * & 0000 0000 0000 01aa \\ \endhead
IAR & & * & 0000 0000 0000 10aa \\ \OpcodeRow{0000 0000 0000 0000}{NOP}
XXX & NOT USED & & 0000 0000 0000 11xx \\ \OpcodeRow{0000 0000 0000 01aa}{DAR}
ADDARN & & * & 0000 0000 0001 bbaa \\ \OpcodeRow{0000 0000 0000 10aa}{IAR}
HALT & & * & 0000 0000 0010 0001 \\ \OpcodeRowUnk{0000 0000 0000 11xx}
& & & \\ \OpcodeRow{0000 0000 0001 bbaa}{ADDARN}
LOOP & & * & 0000 0000 010r rrrr \\ \OpcodeRow{0000 0000 0010 0001}{HALT}
BLOOP & & * & 0000 0000 011r rrrr aaaa aaaa aaaa aaaa \\ \OpcodeRowSkip
& & & \\ \OpcodeRow{0000 0000 010r rrrr}{LOOP}
LRI & & * & 0000 0000 100r rrrr iiii iiii iiii iiii \\ \OpcodeRow{0000 0000 011r rrrr aaaa aaaa aaaa aaaa}{BLOOP}
XXX & NOT USED & * & 0000 0000 101x xxxx \\ \OpcodeRowSkip
LR & & * & 0000 0000 110r rrrr mmmm mmmm mmmm mmmm \\ \OpcodeRow{0000 0000 100r rrrr iiii iiii iiii iiii}{LRI}
SR & & * & 0000 0000 111r rrrr mmmm mmmm mmmm mmmm \\ \OpcodeRowUnk{0000 0000 101x xxxx}
& & & \\ \OpcodeRow{0000 0000 110r rrrr mmmm mmmm mmmm mmmm}{LR}
IF cc & & * & 0000 0010 0111 cccc \\ \OpcodeRow{0000 0000 111r rrrr mmmm mmmm mmmm mmmm}{SR}
JMP cc & & * & 0000 0010 1001 cccc aaaa aaaa aaaa aaaa \\ \OpcodeRowSkip
CALL cc & & * & 0000 0010 1011 cccc aaaa aaaa aaaa aaaa \\ \OpcodeRow{0000 0010 0111 cccc}{IFcc}
RET cc & & * & 0000 0010 1101 cccc \\ \OpcodeRow{0000 0010 1001 cccc aaaa aaaa aaaa aaaa}{Jcc}
RTI & & * & 0000 0010 1111 1111 \\ \OpcodeRow{0000 0010 1011 cccc aaaa aaaa aaaa aaaa}{CALLcc}
& & & \\ \OpcodeRow{0000 0010 1101 cccc}{RETcc}
ADDI & & * & 0000 001r 0000 0000 iiii iiii iiii iiii \\ \OpcodeRow{0000 0010 1111 1111}{RTI}
XORI & & * & 0000 001r 0010 0000 iiii iiii iiii iiii \\ \OpcodeRowSkip
ANDI & & * & 0000 001r 0100 0000 iiii iiii iiii iiii \\ \OpcodeRow{0000 001r 0000 0000 iiii iiii iiii iiii}{ADDI}
ORI & & * & 0000 001r 0110 0000 iiii iiii iiii iiii \\ \OpcodeRow{0000 001r 0010 0000 iiii iiii iiii iiii}{XORI}
CMPI & & * & 0000 001r 1000 0000 iiii iiii iiii iiii \\ \OpcodeRow{0000 001r 0100 0000 iiii iiii iiii iiii}{ANDI}
ANDF & & * & 0000 001r 1010 0000 iiii iiii iiii iiii \\ \OpcodeRow{0000 001r 0110 0000 iiii iiii iiii iiii}{ORI}
ANDCF & & * & 0000 001r 1100 0000 iiii iiii iiii iiii \\ \OpcodeRow{0000 001r 1000 0000 iiii iiii iiii iiii}{CMPI}
& & & \\ \OpcodeRow{0000 001r 1010 0000 iiii iiii iiii iiii}{ANDF}
ILRR & & * & 0000 001r 0001 00aa \\ \OpcodeRow{0000 001r 1100 0000 iiii iiii iiii iiii}{ANDCF}
ILRRD & & * & 0000 001r 0001 01aa \\ \OpcodeRowSkip
ILRRI & & * & 0000 001r 0001 10aa \\ \OpcodeRow{0000 001r 0001 00aa}{ILRR}
ILRRN & & * & 0000 001r 0001 11aa \\ \OpcodeRow{0000 001r 0001 01aa}{ILRRD}
& & & \\ \OpcodeRow{0000 001r 0001 10aa}{ILRRI}
ADDIS & & * & 0000 010d iiii iiii \\ \OpcodeRow{0000 001r 0001 11aa}{ILRRN}
CMPIS & & * & 0000 011d iiii iiii \\ \OpcodeRowSkip
LRIS & & * & 0000 1rrr iiii iiii \\ \OpcodeRow{0000 010d iiii iiii}{ADDIS}
& & & \\ \OpcodeRow{0000 011d iiii iiii}{CMPIS}
LOOPI & & * & 0001 0000 iiii iiii \\ \OpcodeRow{0000 1rrr iiii iiii}{LRIS}
BLOOPI & & * & 0001 0001 iiii iiii aaaa aaaa aaaa aaaa \\ \OpcodeRowSkip
SBCLR & & * & 0001 0010 ???? ?iii \\ \OpcodeRow{0001 0000 iiii iiii}{LOOPI}
SBSET & & * & 0001 0011 ???? ?iii \\ \OpcodeRow{0001 0001 iiii iiii aaaa aaaa aaaa aaaa}{BLOOPI}
LSL/LSR & & * & 0001 010r 0sss ssss \\ \OpcodeRow{0001 0010 xxxx xiii}{SBCLR}
ASL/ASR & & * & 0001 010r 1sss ssss \\ \OpcodeRow{0001 0011 xxxx xiii}{SBSET}
SI & & * & 0001 0110 iiii iiii mmmm mmmm mmmm mmmm \\ \OpcodeRowSkip
CALLR & & * & 0001 0111 rrr1 1111 \\ \OpcodeRow{0001 010r 00ss ssss}{LSL}
JMPR & & * & 0001 0111 rrr0 1111 \\ \OpcodeRow{0001 010r 01ss ssss}{LSR}
LRR(I|D|X) & & * & 0001 100x xaar rrrr \\ \OpcodeRow{0001 010r 10ss ssss}{ASL}
SRR(I|D|X) & & * & 0001 101x xaar rrrr \\ \OpcodeRow{0001 010r 11ss ssss}{ASR}
MRR & & * & 0001 11dd ddds ssss \\ \OpcodeRow{0001 0110 iiii iiii mmmm mmmm mmmm mmmm}{SI}
& & & \\ \OpcodeRow{0001 0111 rrr1 1111}{CALLR}
LRS & & * & 0010 0rrr mmmm mmmm \\ \OpcodeRow{0001 0111 rrr0 1111}{JMPR}
SRS & & * & 0010 1rrr mmmm mmmm \\ \OpcodeRowSkip
& & & \\ \OpcodeRow{0001 1000 0aar rrrr}{LRR}
XORR & & * & 0011 00sr xxxx xxxx \\ \OpcodeRow{0001 1000 1aar rrrr}{LRRD}
ANDR & & * & 0011 01sr xxxx xxxx \\ \OpcodeRow{0001 1001 1aar rrrr}{LRRI}
ORR & & * & 0011 10sr xxxx xxxx \\ \OpcodeRow{0001 1001 1aar rrrr}{LRRN}
ANDC & & * & 0011 110r xxxx xxxx \\ \OpcodeRow{0001 1010 0aar rrrr}{SRR}
ORC & & * & 0011 111r xxxx xxxx \\ \OpcodeRow{0001 1010 1aar rrrr}{SRRD}
& & & \\ \OpcodeRow{0001 1011 0aar rrrr}{SRRI}
ADDR & & * & 0100 0ssd xxxx xxxx \\ \OpcodeRow{0001 1011 1aar rrrr}{SRRN}
ADDAX & & * & 0100 10sd xxxx xxxx \\ \OpcodeRow{0001 11dd ddds ssss}{MRR}
ADD & & * & 0100 110d xxxx xxxx \\ \OpcodeRowSkip
ADDP & & * & 0100 111d xxxx xxxx \\ \OpcodeRow{0010 0rrr mmmm mmmm}{LRS}
& & & \\ \OpcodeRow{0010 1rrr mmmm mmmm}{SRS}
SUBR & & * & 0101 0ssd xxxx xxxx \\ \OpcodeRowSkip
SUBAX & & * & 0101 10sd xxxx xxxx \\ \OpcodeRow{0011 00sr xxxx xxxx}{XORR}
SUB & & * & 0101 110d xxxx xxxx \\ \OpcodeRow{0011 01sr xxxx xxxx}{ANDR}
SUBP & & * & 0101 111d xxxx xxxx \\ \OpcodeRow{0011 10sr xxxx xxxx}{ORR}
& & & \\ \OpcodeRow{0011 110r xxxx xxxx}{ANDC}
MOVR & & * & 0110 0ssd xxxx xxxx \\ \OpcodeRow{0011 111r xxxx xxxx}{ORC}
MOVAX & & * & 0110 10sd xxxx xxxx \\ \OpcodeRowSkip
MOV & & * & 0110 110d xxxx xxxx \\ \OpcodeRow{0100 0ssd xxxx xxxx}{ADDR}
MOVP & & * & 0110 111d xxxx xxxx \\ \OpcodeRow{0100 10sd xxxx xxxx}{ADDAX}
& & & \\ \OpcodeRow{0100 110d xxxx xxxx}{ADD}
ADDAXL & & * & 0111 00sr xxxx xxxx \\ \OpcodeRow{0100 111d xxxx xxxx}{ADDP}
INCM & & * & 0111 010r xxxx xxxx \\ \OpcodeRowSkip
INC & & * & 0111 011r xxxx xxxx \\ \OpcodeRow{0101 0ssd xxxx xxxx}{SUBR}
DECM & & * & 0111 100r xxxx xxxx \\ \OpcodeRow{0101 10sd xxxx xxxx}{SUBAX}
DEC & & * & 0111 101r xxxx xxxx \\ \OpcodeRow{0101 110d xxxx xxxx}{SUB}
NEG & & * & 0111 110r xxxx xxxx \\ \OpcodeRow{0101 111d xxxx xxxx}{SUBP}
MOVNP & & * & 0111 111r xxxx xxxx \\ \OpcodeRowSkip
& & & \\ \OpcodeRow{0110 0ssd xxxx xxxx}{MOVR}
NX & & * & 1000 x000 xxxx xxxx \\ \OpcodeRow{0110 10sd xxxx xxxx}{MOVAX}
CLR & & * & 1000 x001 xxxx xxxx \\ \OpcodeRow{0110 110d xxxx xxxx}{MOV}
CMP & & * & 1000 0010 xxxx xxxx \\ \OpcodeRow{0110 111d xxxx xxxx}{MOVP}
??? & UNUSED & * & 1000 0011 xxxx xxxx \\ \OpcodeRowSkip
CLRP & & * & 1000 0100 xxxx xxxx \\ \OpcodeRow{0111 00sr xxxx xxxx}{ADDAXL}
TSTAXH & & * & 1000 011x xxxx xxxx \\ \OpcodeRow{0111 010r xxxx xxxx}{INCM}
M0/M2 & & & 1000 101x xxxx xxxx \\ \OpcodeRow{0111 011r xxxx xxxx}{INC}
CLR15/SET15 & & & 1000 110x xxxx xxxx \\ \OpcodeRow{0111 100r xxxx xxxx}{DECM}
SET40/16 & & & 1000 111x xxxx xxxx \\ \OpcodeRow{0111 101r xxxx xxxx}{DEC}
& & & \\ \OpcodeRow{0111 110r xxxx xxxx}{NEG}
MUL & & * & 1001 a000 xxxx xxxx \\ \OpcodeRow{0111 111r xxxx xxxx}{MOVNP}
ASR16 & & * & 1001 r001 xxxx xxxx \\ \OpcodeRowSkip
MULMVZ & & * & 1001 a01r xxxx xxxx \\ \OpcodeRow{1000 x000 xxxx xxxx}{NX}
MULAC & & * & 1001 a10r xxxx xxxx \\ \OpcodeRow{1000 x001 xxxx xxxx}{CLR}
MULMV & & * & 1001 a11r xxxx xxxx \\ \OpcodeRow{1000 0010 xxxx xxxx}{CMP}
& & & \\ \OpcodeRowUnk{1000 0011 xxxx xxxx}
MULX & & * & 101b a000 xxxx xxxx \\ \OpcodeRow{1000 0100 xxxx xxxx}{CLRP}
??? & & & 1010 r001 xxxx xxxx \\ \OpcodeRow{1000 011x xxxx xxxx}{TSTAXH}
TST & & & 1011 r001 xxxx xxxx \\ \OpcodeRowSkip
MULXMVZ & & * & 101b a01r xxxx xxxx \\ \OpcodeRow{1000 1010 xxxx xxxx}{M2}
MULXAC & & * & 101b a10r xxxx xxxx \\ \OpcodeRow{1000 1011 xxxx xxxx}{M0}
MULXMV & & * & 101b a11r xxxx xxxx \\ \OpcodeRow{1000 1100 xxxx xxxx}{CLR15}
& & & \\ \OpcodeRow{1000 1101 xxxx xxxx}{SET15}
MULC & & * & 110s a000 xxxx xxxx \\ \OpcodeRow{1000 1110 xxxx xxxx}{SET16}
CMP & & * & 110x r001 xxxx xxxx \\ \OpcodeRow{1000 1111 xxxx xxxx}{SET40}
MULCMVZ & & * & 110s a01r xxxx xxxx \\ \OpcodeRowSkip
MULCAC & & * & 110s a10r xxxx xxxx \\ \OpcodeRow{1001 a000 xxxx xxxx}{MUL}
MULCMV & & * & 110s a11r xxxx xxxx \\ \OpcodeRow{1001 r001 xxxx xxxx}{ASR16}
& & & \\ \OpcodeRow{1001 a01r xxxx xxxx}{MULMVZ}
MADDX & & ** & 1110 00st xxxx xxxx \\ \OpcodeRow{1001 a10r xxxx xxxx}{MULAC}
MSUBX & & ** & 1110 01st xxxx xxxx \\ \OpcodeRow{1001 a11r xxxx xxxx}{MULMV}
MADDC & & ** & 1110 10st xxxx xxxx \\ \OpcodeRowSkip
MSUBC & & ** & 1110 11st xxxx xxxx \\ \OpcodeRow{101b a000 xxxx xxxx}{MULX}
& & & \\ \OpcodeRowUnk{1010 r001 xxxx xxxx}
LSL16 & & * & 1111 000r xxxx xxxx \\ \OpcodeRow{1011 r001 xxxx xxxx}{TST}
MADD & & * & 1111 001s xxxx xxxx \\ \OpcodeRow{101b a01r xxxx xxxx}{MULXMVZ}
LSR16 & & * & 1111 010r xxxx xxxx \\ \OpcodeRow{101b a10r xxxx xxxx}{MULXAC}
MSUB & & * & 1111 011s xxxx xxxx \\ \OpcodeRow{101b a11r xxxx xxxx}{MULXMV}
ADDPAXZ & & * & 1111 10ar xxxx xxxx \\ \OpcodeRowSkip
CLRL & & * & 1111 110r xxxx xxxx \\ \OpcodeRow{110s a000 xxxx xxxx}{MULC}
MOVPZ & & * & 1111 111r xxxx xxxx \OpcodeRow{110x r001 xxxx xxxx}{CMP}
\OpcodeRow{110s a01r xxxx xxxx}{MULCMVZ}
\OpcodeRow{110s a10r xxxx xxxx}{MULCAC}
\OpcodeRow{110s a11r xxxx xxxx}{MULCMV}
\OpcodeRowSkip
\OpcodeRow{1110 00st xxxx xxxx}{MADDX}
\OpcodeRow{1110 01st xxxx xxxx}{MSUBX}
\OpcodeRow{1110 10st xxxx xxxx}{MADDC}
\OpcodeRow{1110 11st xxxx xxxx}{MSUBC}
\OpcodeRowSkip
\OpcodeRow{1111 000r xxxx xxxx}{LSL16}
\OpcodeRow{1111 001s xxxx xxxx}{MADD}
\OpcodeRow{1111 010r xxxx xxxx}{LSR16}
\OpcodeRow{1111 011s xxxx xxxx}{MSUB}
\OpcodeRow{1111 10ar xxxx xxxx}{ADDPAXZ}
\OpcodeRow{1111 110r xxxx xxxx}{CLRL}
\OpcodeRow{1111 111r xxxx xxxx}{MOVPZ}
\end{longtable} \end{longtable}
\end{center} \end{center}
\begin{center} \begin{center}
Extension Opcodes Extension Opcodes
\begin{longtable}{TllT} \begin{longtable}{llr}
[D|I|N]R & & * & xxxx xxxx 0000 nnaa \\ Instruction & Opcode & Page \\ \hline
MV & & * & xxxx xxxx 0001 ddss \\ \OpcodeRow{xxxx xxxx 0000 01aa}{'DR}
S[N] & & * & xxxx xxxx 001r rnaa \\ \OpcodeRow{xxxx xxxx 0000 10aa}{'IR}
L[N] & & * & xxxx xxxx 01dd diss \\ \OpcodeRow{xxxx xxxx 0000 11aa}{'NR}
LS[NM|M|N] & & * & xxxx xxxx 10dd ba0r \\ \OpcodeRow{xxxx xxxx 0001 ddss}{'MV}
SL[NM|M|N] & & * & xxxx xxxx 10dd ba1r \\ \OpcodeRow{xxxx xxxx 001r r0aa}{'S}
LD[NM|M|N] & & & xxxx xxxx 11mn barr \\ \OpcodeRow{xxxx xxxx 001r r1aa}{'SN}
LD2[NM|M|N] & & & xxxx xxxx 11rm ba11 \OpcodeRow{xxxx xxxx 01dd d0ss}{'L}
\OpcodeRow{xxxx xxxx 01dd d1ss}{'LN}
\OpcodeRowSkip
\OpcodeRow{xxxx xxxx 10dd 000r}{'LS}
\OpcodeRow{xxxx xxxx 10dd 001r}{'SL}
\OpcodeRow{xxxx xxxx 10dd 010r}{'LSN}
\OpcodeRow{xxxx xxxx 10dd 011r}{'SLN}
\OpcodeRow{xxxx xxxx 10dd 100r}{'LSM}
\OpcodeRow{xxxx xxxx 10dd 101r}{'SLM}
\OpcodeRow{xxxx xxxx 10dd 110r}{'LSNM}
\OpcodeRow{xxxx xxxx 10dd 111r}{'SLNM}
\OpcodeRow{xxxx xxxx 11mn barr}{'LD[NM|M|N]}
\OpcodeRow{xxxx xxxx 11rm ba11}{'LD2[NM|M|N]}
\end{longtable} \end{longtable}
\end{center} \end{center}