\subsection{\index{syscall}syscall}

\index{operating system call}
operating SYStem CALL


\begin{tabular}{l}
  {\bf syscall Imm16, r1} \\
  {\bf trap Imm16, r1} \\
\end{tabular}

~~~~~~
jump in supervisor mode and execute the service \# Imm16.

~~~~~~
If the {\bf T}rap flag is set, the user-mode application gives up his current 
time slice and requests a critical service (the SRB mechanism is triggered).

~~~~~~
The r1 operand is not (yet) used, it is cleared. The argument is ignored by 
the hardware and may be used to encode information for system software. To 
retrieve the argument system software must load the instruction word from 
memory.

~~~~~~
Typically, the service's entry point address is computed with the immediate 
value (shifted left by 6, as it appears in the instruction, as to have 
16-instruction entry points) and added to a supervisor-mode Special Register. 
In the same time, the immediate value is compared with another Special Register 
which specifies the maximum number of implemented services, and a trap is 
triggered if there is an overflow.

\begin{center}

\begin{tabular}{|l|l|l|l|l|l|}
 \hline
\multicolumn{1}{|r| }{size :
} & \multicolumn{1}{c| }{8
} & \multicolumn{1}{c| }{1
} & \multicolumn{1}{c| }{1
} & \multicolumn{1}{c| }{16
} & \multicolumn{1}{c| }{6
 } \\
 \hline
\multicolumn{1}{|r| }{bits :
} & {31 ~ ~ ~ ~ ~ ~ ~ ~ 24
} & {23
} & {22
} & {21 ~ ~ ~ ~ ~ ~
~ ~ ~ ~ ~ ~
~ ~ ~ ~ ~ ~ 6
} & {5 ~ ~ ~ ~ ~ ~ 0
 } \\
 \hline
\multicolumn{1}{|r| }{function :
} & \multicolumn{1}{c| }{OP\_SYSCALL
} & \multicolumn{1}{c| }{T
} & \multicolumn{1}{c| }{0
} & \multicolumn{1}{c| }{Imm16
} & \multicolumn{1}{c| }{Reg 1
}
\\ \hline

\end{tabular}

{\bf Performance (FC0 only) :}
\end{center}

{\em Execution Unit :} none\\
{\em Latency :} unknown.\\
{\em Throughput :} unknown.\\

~

\pagebreak


