OpenCores
URL https://opencores.org/ocsvn/marca/marca/trunk

Subversion Repositories marca

[/] [marca/] [tags/] [INITIAL/] [doc/] [isa.tex] - Diff between revs 3 and 8

Only display areas with differences | Details | Blame | View Log

Rev 3 Rev 8
\documentclass[10pt, twoside, a4paper]{article}
\documentclass[10pt, twoside, a4paper]{article}
\usepackage{longtable}
\usepackage{longtable}
 
 
\newcommand{\shl}{\ensuremath{<\!\!<}}
\newcommand{\shl}{\ensuremath{<\!\!<}}
\newcommand{\shr}{\ensuremath{>\!\!>\!\!>}}
\newcommand{\shr}{\ensuremath{>\!\!>\!\!>}}
\newcommand{\sar}{\ensuremath{>\!\!>}}
\newcommand{\sar}{\ensuremath{>\!\!>}}
\newcommand{\at}{\ensuremath{\!\!:\!\!}}
\newcommand{\at}{\ensuremath{\!\!:\!\!}}
 
 
\title{marca - McAdam's RISC Computer Architecture\\Instruction Set Architecture}
\title{marca - McAdam's RISC Computer Architecture\\Instruction Set Architecture}
\author{Kenan Bilic, Roland Kammerer, Wolfgang Puffitsch}
\author{Kenan Bilic, Roland Kammerer, Wolfgang Puffitsch}
 
 
\begin{document}
\begin{document}
 
 
  \maketitle
  \maketitle
 
 
  \section{General}
  \section{General}
 
 
  \begin{itemize}
  \begin{itemize}
  \item 16 16-bit registers, r0 \ldots r15
  \item 16 16-bit registers, r0 \ldots r15
  \item any register as return address
  \item any register as return address
  \item flags: Z, C, V, N
  \item flags: Z, C, V, N
    \begin{itemize}
    \begin{itemize}
    \item Z: all bits of the last result are zero
    \item Z: all bits of the last result are zero
    \item C: ``17$^{th}$ bit'' of the last result
    \item C: ``17$^{th}$ bit'' of the last result
    \item N: 16$^{th}$ bit of the last result
    \item N: 16$^{th}$ bit of the last result
    \item V: overflow, after sub/cmp it is $r1 \at 15 \oplus r2 \at 15
    \item V: overflow, after sub/cmp it is $r1 \at 15 \oplus r2 \at 15
      \oplus N \oplus C$, the latter two according to the result,
      \oplus N \oplus C$, the latter two according to the result,
      other operations accordingly
      other operations accordingly
    \item I: allow interrupts
    \item I: allow interrupts
    \item P: parity of the last result
    \item P: parity of the last result
    \end{itemize}
    \end{itemize}
    Flags are written where meaningful: P and Z are computed whenever
    Flags are written where meaningful: P and Z are computed whenever
    a register is written, arithmetic operations may change C, N and
    a register is written, arithmetic operations may change C, N and
    V, interrupts clear I upon entry.
    V, interrupts clear I upon entry.
  \item flags are stored and restored upon interrupt entry and exit
  \item flags are stored and restored upon interrupt entry and exit
    to/from ``shflags'' (shadow flags)
    to/from ``shflags'' (shadow flags)
  \item separate registers for interrupt vectors - read and written
  \item separate registers for interrupt vectors - read and written
    through ``ldvec'' / ``stvec''
    through ``ldvec'' / ``stvec''
  \item Some parts come from the Alpha architecture. The handling of
  \item Some parts come from the Alpha architecture. The handling of
    branches is inspired by the Intel x86.
    branches is inspired by the Intel x86.
  \item External hardware modules shall be mapped to the highest
  \item External hardware modules shall be mapped to the highest
    memory locations.
    memory locations.
  \end{itemize}
  \end{itemize}
 
 
  The processor uses a Harvard architecture; although it has not
  The processor uses a Harvard architecture; although it has not
  prevailed in mainstream-architectures, it is still used in embedded
  prevailed in mainstream-architectures, it is still used in embedded
  processors such as the Atmel AVR. The separation of code- and
  processors such as the Atmel AVR. The separation of code- and
  data-memory is not flexible enough for mainstream systems, but with
  data-memory is not flexible enough for mainstream systems, but with
  small embedded processors the program code tends to be fixed
  small embedded processors the program code tends to be fixed
  anyway. A Harvard architecture enables the processor to make use of
  anyway. A Harvard architecture enables the processor to make use of
  more memory (which is an issue when the address space is limited to
  more memory (which is an issue when the address space is limited to
  64k), and the program code can be read from a ROM directly. A
  64k), and the program code can be read from a ROM directly. A
  transient failure thus cannot destroy the program by overwriting its
  transient failure thus cannot destroy the program by overwriting its
  code section.
  code section.
 
 
  \clearpage
  \clearpage
 
 
  \section{Instruction Set}
  \section{Instruction Set}
 
 
  {\small
  {\small
  \begin{longtable}{llp{.62\textwidth}}
  \begin{longtable}{llp{.62\textwidth}}
    Instruction       & Opcode                & Semantics \\
    Instruction       & Opcode                & Semantics \\
    add r1, r2, r3    & \texttt{0000}         & $r1 + r2 \rightarrow r3$ \\
    add r1, r2, r3    & \texttt{0000}         & $r1 + r2 \rightarrow r3$ \\
    sub r1, r2, r3    & \texttt{0001}         & $r1 - r2 \rightarrow r3$ \\
    sub r1, r2, r3    & \texttt{0001}         & $r1 - r2 \rightarrow r3$ \\
    addc r1, r2, r3   & \texttt{0010}         & $r1 + r2 + C \rightarrow r3$ \\
    addc r1, r2, r3   & \texttt{0010}         & $r1 + r2 + C \rightarrow r3$ \\
    subc r1, r2, r3   & \texttt{0011}         & $r1 - r2 - C \rightarrow r3$ \\
    subc r1, r2, r3   & \texttt{0011}         & $r1 - r2 - C \rightarrow r3$ \\
    and r1, r2, r3    & \texttt{0100}         & $r1 \wedge r2 \rightarrow r3$ \\
    and r1, r2, r3    & \texttt{0100}         & $r1 \wedge r2 \rightarrow r3$ \\
    or r1, r2, r3     & \texttt{0101}         & $r1 \vee r2 \rightarrow r3$ \\
    or r1, r2, r3     & \texttt{0101}         & $r1 \vee r2 \rightarrow r3$ \\
    xor r1, r2, r3    & \texttt{0110}         & $r1 \oplus r2 \rightarrow r3$ \\
    xor r1, r2, r3    & \texttt{0110}         & $r1 \oplus r2 \rightarrow r3$ \\
    mul r1, r2, r3    & \texttt{0111}         & $r1 * r2 \rightarrow r3$ \\
    mul r1, r2, r3    & \texttt{0111}         & $r1 * r2 \rightarrow r3$ \\
    div r1, r2, r3    & \texttt{1000}         & $r1 \div r2 \rightarrow r3$ \\
    div r1, r2, r3    & \texttt{1000}         & $r1 \div r2 \rightarrow r3$ \\
    udiv r1, r2, r3   & \texttt{1001}         & $r1 \div r2 \rightarrow r3, \textnormal{unsigned} $ \\
    udiv r1, r2, r3   & \texttt{1001}         & $r1 \div r2 \rightarrow r3, \textnormal{unsigned} $ \\
    ldil r1, n8       & \texttt{1010}         & $(r1 \wedge \texttt{0xff00}) \vee n8 \rightarrow r1, -128 \leq n8 \leq 255 $ \\
    ldil r1, n8       & \texttt{1010}         & $(r1 \wedge \texttt{0xff00}) \vee n8 \rightarrow r1, -128 \leq n8 \leq 255 $ \\
    ldih r1, n8       & \texttt{1011}         & $(r1 \wedge \texttt{0x00ff}) \vee (n8 \shl 8) \rightarrow r1, -128 \leq n8 \leq 255 $ \\
    ldih r1, n8       & \texttt{1011}         & $(r1 \wedge \texttt{0x00ff}) \vee (n8 \shl 8) \rightarrow r1, -128 \leq n8 \leq 255 $ \\
    ldib r1, n8       & \texttt{1100}         & $n8 \rightarrow r1, -128 \leq n8 \leq 127$ \\
    ldib r1, n8       & \texttt{1100}         & $n8 \rightarrow r1, -128 \leq n8 \leq 127$ \\
  \hline
  \hline
    mov r1, r2        & \texttt{11010000}     & $r2 \rightarrow r1$ \\
    mov r1, r2        & \texttt{11010000}     & $r2 \rightarrow r1$ \\
    mod r1, r2        & \texttt{11010001}     & $r1\ \textnormal{mod}\ r2 \rightarrow r1$ \\
    mod r1, r2        & \texttt{11010001}     & $r1\ \textnormal{mod}\ r2 \rightarrow r1$ \\
    umod r1, r2       & \texttt{11010010}     & $r1\ \textnormal{mod}\ r2 \rightarrow r1, \textnormal{unsigned} $ \\
    umod r1, r2       & \texttt{11010010}     & $r1\ \textnormal{mod}\ r2 \rightarrow r1, \textnormal{unsigned} $ \\
    not r1, r2        & \texttt{11010011}     & $\lnot r2 \rightarrow r1$ \\
    not r1, r2        & \texttt{11010011}     & $\lnot r2 \rightarrow r1$ \\
    neg r1, r2        & \texttt{11010100}     & $-r1 \rightarrow r2$ \\
    neg r1, r2        & \texttt{11010100}     & $-r1 \rightarrow r2$ \\
    cmp r1, r2        & \texttt{11010101}     & $r1 - r2, \textnormal{sets flags}$ \\
    cmp r1, r2        & \texttt{11010101}     & $r1 - r2, \textnormal{sets flags}$ \\
    addi r1, n4       & \texttt{11010110}     & $r1 + n4 \rightarrow r1, -8 \leq n4 \leq 7$ \\
    addi r1, n4       & \texttt{11010110}     & $r1 + n4 \rightarrow r1, -8 \leq n4 \leq 7$ \\
    cmpi r1, n4       & \texttt{11010111}     & $r1 - n4, \textnormal{sets flags}, -8 \leq n4 \leq 7$ \\
    cmpi r1, n4       & \texttt{11010111}     & $r1 - n4, \textnormal{sets flags}, -8 \leq n4 \leq 7$ \\
    shl r1, r2        & \texttt{11011000}     & $r1 \shl r2 \rightarrow r1$ \\
    shl r1, r2        & \texttt{11011000}     & $r1 \shl r2 \rightarrow r1$ \\
    shr r1, r2        & \texttt{11011001}     & $r1 \shr r2 \rightarrow r1$ \\
    shr r1, r2        & \texttt{11011001}     & $r1 \shr r2 \rightarrow r1$ \\
    sar r1, r2        & \texttt{11011010}     & $r1 \sar r2 \rightarrow r1$ \\
    sar r1, r2        & \texttt{11011010}     & $r1 \sar r2 \rightarrow r1$ \\
    rolc r1, r2       & \texttt{11011011}     & $(r1 \shl r2) \vee (C \shl (r2-1)) \vee (r1 \shr (16-r2-1))$ \\
    rolc r1, r2       & \texttt{11011011}     & $(r1 \shl r2) \vee (C \shl (r2-1)) \vee (r1 \shr (16-r2-1))$ \\
    rorc r1, r2       & \texttt{11011100}     & $(r1 \shr r2) \vee (C \shl (16-r2)) \vee (r1 \shl (16-r2-1))$ \\
    rorc r1, r2       & \texttt{11011100}     & $(r1 \shr r2) \vee (C \shl (16-r2)) \vee (r1 \shl (16-r2-1))$ \\
    bset r1, n4       & \texttt{11011101}     & $r1 \vee (1 \shl n4) \rightarrow r1, 0 \leq n4 \leq 15$ \\
    bset r1, n4       & \texttt{11011101}     & $r1 \vee (1 \shl n4) \rightarrow r1, 0 \leq n4 \leq 15$ \\
    bclr r1, n4       & \texttt{11011110}     & $r1 \wedge \lnot (1 \shl n4) \rightarrow r1, 0 \leq n4 \leq 15$ \\
    bclr r1, n4       & \texttt{11011110}     & $r1 \wedge \lnot (1 \shl n4) \rightarrow r1, 0 \leq n4 \leq 15$ \\
    btest r1, n4      & \texttt{11011111}     & $(r1 \shr n4) \wedge 1 \rightarrow Z, 0 \leq n4 \leq 15$ \\
    btest r1, n4      & \texttt{11011111}     & $(r1 \shr n4) \wedge 1 \rightarrow Z, 0 \leq n4 \leq 15$ \\
  \hline
  \hline
    load r1, r2       & \texttt{11100000}     & $[r2] \at [r2+1] \rightarrow r1$ \\
    load r1, r2       & \texttt{11100000}     & $[r2] \at [r2+1] \rightarrow r1$ \\
    store r1, r2      & \texttt{11100001}     & $r1 \rightarrow [r2] \at [r2+1]$ \\
    store r1, r2      & \texttt{11100001}     & $r1 \rightarrow [r2] \at [r2+1]$ \\
    loadl r1, r2      & \texttt{11100010}     & $(r1 \wedge \texttt{0xff00}) \vee [r2] \rightarrow r1$ \\
    loadl r1, r2      & \texttt{11100010}     & $(r1 \wedge \texttt{0xff00}) \vee [r2] \rightarrow r1$ \\
    loadh r1, r2      & \texttt{11100011}     & $(r1 \wedge \texttt{0x00ff}) \vee ([r2] \shl 8) \rightarrow r1$ \\
    loadh r1, r2      & \texttt{11100011}     & $(r1 \wedge \texttt{0x00ff}) \vee ([r2] \shl 8) \rightarrow r1$ \\
    loadb r1, r2      & \texttt{11100100}     & $[r2] \rightarrow r1, \textnormal{signed}$ \\
    loadb r1, r2      & \texttt{11100100}     & $[r2] \rightarrow r1, \textnormal{signed}$ \\
    storel r1, r2     & \texttt{11100101}     & $(r1 \wedge \texttt{0x00ff}) \rightarrow [r2]$ \\
    storel r1, r2     & \texttt{11100101}     & $(r1 \wedge \texttt{0x00ff}) \rightarrow [r2]$ \\
    storeh r1, r2     & \texttt{11100110}     & $(r1 \shr 8) \rightarrow [r2]$ \\
    storeh r1, r2     & \texttt{11100110}     & $(r1 \shr 8) \rightarrow [r2]$ \\
    call r1, r2       & \texttt{11101000}     & $r1 \rightarrow pc, pc \rightarrow r2$ \\
    call r1, r2       & \texttt{11101000}     & $r1 \rightarrow pc, pc \rightarrow r2$ \\
  \hline
  \hline
    br n8             & \texttt{11110000}     & $pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    br n8             & \texttt{11110000}     & $pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brz n8            & \texttt{11110001}     & $Z = 1 \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brz n8            & \texttt{11110001}     & $Z = 1 \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brnz n8           & \texttt{11110010}     & $Z = 0 \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brnz n8           & \texttt{11110010}     & $Z = 0 \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brle n8           & \texttt{11110011}     & $(Z = 1) \vee (N \not = V) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brle n8           & \texttt{11110011}     & $(Z = 1) \vee (N \not = V) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brlt n8           & \texttt{11110100}     & $(Z = 0) \wedge (N \not = V) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brlt n8           & \texttt{11110100}     & $(Z = 0) \wedge (N \not = V) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brge n8           & \texttt{11110101}     & $(Z = 1) \vee (N = V) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brge n8           & \texttt{11110101}     & $(Z = 1) \vee (N = V) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brgt n8           & \texttt{11110110}     & $(Z = 0) \wedge (N = V) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brgt n8           & \texttt{11110110}     & $(Z = 0) \wedge (N = V) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brule n8          & \texttt{11110111}     & $(Z = 1) \vee (C = 1) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brule n8          & \texttt{11110111}     & $(Z = 1) \vee (C = 1) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brult n8          & \texttt{11111000}     & $(Z = 0) \wedge (C = 1) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brult n8          & \texttt{11111000}     & $(Z = 0) \wedge (C = 1) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    bruge n8          & \texttt{11111001}     & $(Z = 1) \vee (C = 0) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    bruge n8          & \texttt{11111001}     & $(Z = 1) \vee (C = 0) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brugt n8          & \texttt{11111010}     & $(Z = 0) \wedge (C = 0) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    brugt n8          & \texttt{11111010}     & $(Z = 0) \wedge (C = 0) \Rightarrow pc + n8 \rightarrow pc, -128 \leq n8 \leq 127$ \\
    sext r1, r2       & \texttt{11111011}     & $(r1 \shl 8) \sar 8 \rightarrow r2$ \\
    sext r1, r2       & \texttt{11111011}     & $(r1 \shl 8) \sar 8 \rightarrow r2$ \\
    ldvec r1, n4      & \texttt{11111100}     & $\textnormal{interrupt vector}\ n4 \rightarrow r1, 0 \leq n4 \leq 15$ \\
    ldvec r1, n4      & \texttt{11111100}     & $\textnormal{interrupt vector}\ n4 \rightarrow r1, 0 \leq n4 \leq 15$ \\
    stvec r1, n4      & \texttt{11111101}     & $r1 \rightarrow \textnormal{interrupt vector}\ n4, 0 \leq n4 \leq 15$ \\
    stvec r1, n4      & \texttt{11111101}     & $r1 \rightarrow \textnormal{interrupt vector}\ n4, 0 \leq n4 \leq 15$ \\
  \hline
  \hline
    jmp r1            & \texttt{111111100000} & $r1 \rightarrow pc$ \\
    jmp r1            & \texttt{111111100000} & $r1 \rightarrow pc$ \\
    jmpz r1           & \texttt{111111100001} & $Z = 1 \Rightarrow r1 \rightarrow pc$ \\
    jmpz r1           & \texttt{111111100001} & $Z = 1 \Rightarrow r1 \rightarrow pc$ \\
    jmpnz r1          & \texttt{111111100010} & $Z = 0 \Rightarrow r1 \rightarrow pc$ \\
    jmpnz r1          & \texttt{111111100010} & $Z = 0 \Rightarrow r1 \rightarrow pc$ \\
    jmple r1          & \texttt{111111100011} & $(Z = 1) \vee (N \not = V) \Rightarrow r1 \rightarrow pc$ \\
    jmple r1          & \texttt{111111100011} & $(Z = 1) \vee (N \not = V) \Rightarrow r1 \rightarrow pc$ \\
    jmplt r1          & \texttt{111111100100} & $(Z = 0) \wedge (N \not = V) \Rightarrow r1 \rightarrow pc$ \\
    jmplt r1          & \texttt{111111100100} & $(Z = 0) \wedge (N \not = V) \Rightarrow r1 \rightarrow pc$ \\
    jmpge r1          & \texttt{111111100101} & $(Z = 1) \vee (N = V) \Rightarrow r1 \rightarrow pc$ \\
    jmpge r1          & \texttt{111111100101} & $(Z = 1) \vee (N = V) \Rightarrow r1 \rightarrow pc$ \\
    jmpgt r1          & \texttt{111111100110} & $(Z = 0) \wedge (N = V) \Rightarrow r1 \rightarrow pc$ \\
    jmpgt r1          & \texttt{111111100110} & $(Z = 0) \wedge (N = V) \Rightarrow r1 \rightarrow pc$ \\
    jmpule r1         & \texttt{111111100111} & $(Z = 1) \vee (C = 1) \Rightarrow r1 \rightarrow pc$ \\
    jmpule r1         & \texttt{111111100111} & $(Z = 1) \vee (C = 1) \Rightarrow r1 \rightarrow pc$ \\
    jmpult r1         & \texttt{111111101000} & $(Z = 0) \wedge (C = 1) \Rightarrow r1 \rightarrow pc$ \\
    jmpult r1         & \texttt{111111101000} & $(Z = 0) \wedge (C = 1) \Rightarrow r1 \rightarrow pc$ \\
    jmpuge r1         & \texttt{111111101001} & $(Z = 1) \vee (C = 0) \Rightarrow r1 \rightarrow pc$ \\
    jmpuge r1         & \texttt{111111101001} & $(Z = 1) \vee (C = 0) \Rightarrow r1 \rightarrow pc$ \\
    jmpugt r1         & \texttt{111111101010} & $(Z = 0) \wedge (C = 0) \Rightarrow r1 \rightarrow pc$ \\
    jmpugt r1         & \texttt{111111101010} & $(Z = 0) \wedge (C = 0) \Rightarrow r1 \rightarrow pc$ \\
    intr n4           & \texttt{111111101011} & $\textnormal{interrupt vector}\ n4 \rightarrow pc, pc \rightarrow ira, flags \rightarrow shflags, 0 \leq n4 \leq 15$ \\
    intr n4           & \texttt{111111101011} & $\textnormal{interrupt vector}\ n4 \rightarrow pc, pc \rightarrow ira, flags \rightarrow shflags, 0 \leq n4 \leq 15$ \\
    getira r1         & \texttt{111111101100} & $ira \rightarrow r1$ \\
    getira r1         & \texttt{111111101100} & $ira \rightarrow r1$ \\
    setira r1         & \texttt{111111101101} & $r1 \rightarrow ira$ \\
    setira r1         & \texttt{111111101101} & $r1 \rightarrow ira$ \\
    getfl r1          & \texttt{111111101110} & $flags \rightarrow r1$ \\
    getfl r1          & \texttt{111111101110} & $flags \rightarrow r1$ \\
    setfl r1          & \texttt{111111101111} & $r1 \rightarrow flags$ \\
    setfl r1          & \texttt{111111101111} & $r1 \rightarrow flags$ \\
    getshfl r1        & \texttt{111111110000} & $shflags \rightarrow r1$ \\
    getshfl r1        & \texttt{111111110000} & $shflags \rightarrow r1$ \\
    setshfl r1        & \texttt{111111110001} & $r1 \rightarrow shflags$ \\
    setshfl r1        & \texttt{111111110001} & $r1 \rightarrow shflags$ \\
  \hline
  \hline
    reti              & \texttt{1111111111110000} & $ira \rightarrow pc, shflags \rightarrow flags$ \\
    reti              & \texttt{1111111111110000} & $ira \rightarrow pc, shflags \rightarrow flags$ \\
    nop               & \texttt{1111111111110001} & $\textnormal{do nothing}$ \\
    nop               & \texttt{1111111111110001} & $\textnormal{do nothing}$ \\
    sei               & \texttt{1111111111110010} & $1 \rightarrow I$ \\
    sei               & \texttt{1111111111110010} & $1 \rightarrow I$ \\
    cli               & \texttt{1111111111110011} & $0 \rightarrow I$ \\
    cli               & \texttt{1111111111110011} & $0 \rightarrow I$ \\
    error             & \texttt{1111111111111111} & $\textnormal{invalid operation}$ \\
    error             & \texttt{1111111111111111} & $\textnormal{invalid operation}$ \\
  \end{longtable}}
  \end{longtable}}
 
 
  \subsection{NOTES}
  \subsection{NOTES}
  \begin{itemize}
  \begin{itemize}
  \item Apart from the standard operators, the following notation is
  \item Apart from the standard operators, the following notation is
    used in the table above:
    used in the table above:
    \begin{itemize}
    \begin{itemize}
    \item \shl, \shr, \sar are shifting operators, with semantics as in Java
    \item \shl, \shr, \sar are shifting operators, with semantics as in Java
    \item $[x]$ means accessing memory location $x$, 8 bits wide
    \item $[x]$ means accessing memory location $x$, 8 bits wide
    \item $x \at y$ means concatenating $x$ and $y$, in the sense of
    \item $x \at y$ means concatenating $x$ and $y$, in the sense of
      forming a 16-bit value from two 8-bit values
      forming a 16-bit value from two 8-bit values
    \end{itemize}
    \end{itemize}
  \item Modulo does not follow the patterns for ``div'' and ``udiv'',
  \item Modulo does not follow the patterns for ``div'' and ``udiv'',
    because there was not enough room for two more 3-operand
    because there was not enough room for two more 3-operand
    operations. The assembler accepts the mnemonic with 3 registers as
    operations. The assembler accepts the mnemonic with 3 registers as
    operands and substitute it with the according ``mov'' and ``mod''
    operands and substitute it with the according ``mov'' and ``mod''
    instructions.
    instructions.
  \end{itemize}
  \end{itemize}
 
 
  \clearpage
  \clearpage
 
 
  \subsection{Instruction formats}
  \subsection{Instruction formats}
 
 
  The following formats for instructions are to be used:
  The following formats for instructions are to be used:
 
 
  \begin{center}
  \begin{center}
    \begin{tabular}{|p{1in}|p{1in}|p{1in}|p{1in}|}
    \begin{tabular}{|p{1in}|p{1in}|p{1in}|p{1in}|}
      \hline
      \hline
      Bits 15 \ldots 12 & Bits 11 \ldots 8 & Bits 7 \ldots 4 & Bits 3 \ldots 0 \\
      Bits 15 \ldots 12 & Bits 11 \ldots 8 & Bits 7 \ldots 4 & Bits 3 \ldots 0 \\
      \hline
      \hline
      Opcode                & r3   & r2 & r1 \\
      Opcode                & r3   & r2 & r1 \\
      \hline
      \hline
      Opcode                & \multicolumn{2}{|l|}{n8} & r1 \\
      Opcode                & \multicolumn{2}{|l|}{n8} & r1 \\
      \hline
      \hline
      \multicolumn{2}{|l|}{Opcode} & r2 & r1 \\
      \multicolumn{2}{|l|}{Opcode} & r2 & r1 \\
      \hline
      \hline
      \multicolumn{2}{|l|}{Opcode} & n4 & r1 \\
      \multicolumn{2}{|l|}{Opcode} & n4 & r1 \\
      \hline
      \hline
      \multicolumn{2}{|l|}{Opcode} & \multicolumn{2}{|l|}{n8} \\
      \multicolumn{2}{|l|}{Opcode} & \multicolumn{2}{|l|}{n8} \\
      \hline
      \hline
      \multicolumn{3}{|l|}{Opcode} & r1 \\
      \multicolumn{3}{|l|}{Opcode} & r1 \\
      \hline
      \hline
      \multicolumn{3}{|l|}{Opcode} & n4 \\
      \multicolumn{3}{|l|}{Opcode} & n4 \\
      \hline
      \hline
      \multicolumn{4}{|l|}{Opcode} \\
      \multicolumn{4}{|l|}{Opcode} \\
      \hline
      \hline
    \end{tabular}
    \end{tabular}
  \end{center}
  \end{center}
 
 
  \section{Versions Of This Document}
  \section{Versions Of This Document}
 
 
  2006-10-04: Draft version \textbf{0.1}
  2006-10-04: Draft version \textbf{0.1}
 
 
  \noindent
  \noindent
  2006-10-05: Draft version \textbf{0.2}
  2006-10-05: Draft version \textbf{0.2}
  \begin{itemize}
  \begin{itemize}
    \item rearrangement of some ops
    \item rearrangement of some ops
  \end{itemize}
  \end{itemize}
 
 
  \noindent
  \noindent
  2006-10-11: Draft version \textbf{0.3}
  2006-10-11: Draft version \textbf{0.3}
  \begin{itemize}
  \begin{itemize}
    \item replaced ``ror''/``rol'' with ``mod''/``umod''
    \item replaced ``ror''/``rol'' with ``mod''/``umod''
    \item refined considerations of direction flag
    \item refined considerations of direction flag
    \item proposal for priorities of implementation
    \item proposal for priorities of implementation
  \end{itemize}
  \end{itemize}
 
 
  \noindent
  \noindent
  2006-10-28: Draft version \textbf{0.4}
  2006-10-28: Draft version \textbf{0.4}
  \begin{itemize}
  \begin{itemize}
    \item settled to singed loads
    \item settled to singed loads
    \item settled to shifts by registers
    \item settled to shifts by registers
    \item dropped ``push''/``pop''; the secondary result would cause a
    \item dropped ``push''/``pop''; the secondary result would cause a
      considerable overhead
      considerable overhead
    \item specified pipelining
    \item specified pipelining
  \end{itemize}
  \end{itemize}
 
 
  \noindent
  \noindent
  2006-10-30: Draft version \textbf{0.5}
  2006-10-30: Draft version \textbf{0.5}
  \begin{itemize}
  \begin{itemize}
    \item added shflags to ease interrupt (and stack) handling
    \item added shflags to ease interrupt (and stack) handling
    \item a few refinements
    \item a few refinements
  \end{itemize}
  \end{itemize}
 
 
  \noindent
  \noindent
  2006-12-02: Draft version \textbf{0.6}
  2006-12-02: Draft version \textbf{0.6}
  \begin{itemize}
  \begin{itemize}
    \item the first register is the target with ``mov'' and ``not'' now.
    \item the first register is the target with ``mov'' and ``not'' now.
    \item now the second register is always the address when accessing memory
    \item now the second register is always the address when accessing memory
    \item reversed order with immediate loads
    \item reversed order with immediate loads
    \item ``ldvec'' and ``stvec'' use the same order now
    \item ``ldvec'' and ``stvec'' use the same order now
    \item fixed instruction format for immediate loads
    \item fixed instruction format for immediate loads
  \end{itemize}
  \end{itemize}
 
 
  \noindent
  \noindent
  2006-12-14: Draft version \textbf{0.7}
  2006-12-14: Draft version \textbf{0.7}
  \begin{itemize}
  \begin{itemize}
  \item dropped ``ldpgm'' in favor of a ROM which is mapped to the
  \item dropped ``ldpgm'' in favor of a ROM which is mapped to the
    ordinary memory space
    ordinary memory space
  \item moved section about pipelinign to the implementation document
  \item moved section about pipelinign to the implementation document
  \item removed note about interrupts; they are implemented already
  \item removed note about interrupts; they are implemented already
  \end{itemize}
  \end{itemize}
 
 
\end{document}
\end{document}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.