| version 1.1, 2001/06/19 07:32:58 |
version 1.4, 2001/06/21 03:09:46 |
|
|
| % $OpenXM$ |
% $OpenXM: OpenXM/doc/ascm2001p/openxm-stackmachines.tex,v 1.3 2001/06/21 00:15:34 takayama Exp $ |
| |
|
| \section{OpenXM Stack machines}\label{sec:ox-stackmachines} |
\section{OpenXM Stack machines}\label{sec:ox-stackmachines} |
| |
|
| In OpenXM specification, all servers are stack machines. |
In the OpenXM specification, all servers are stack machines. |
| %These are called OpenXM stack machines. |
%These are called OpenXM stack machines. |
| When a server ox\_xyz gets an OX data message, |
When a server ox\_xyz gets an OX data message, |
| it translates the data into a local object of ox\_xyz |
it translates the data into a local object of ox\_xyz |
|
|
| {\tt OX\_DATA} stands for {\tt OX\_DATA} header and |
{\tt OX\_DATA} stands for {\tt OX\_DATA} header and |
| {\tt (CMO\_ZZ,1)} is a body standing for $1$ expressed |
{\tt (CMO\_ZZ,1)} is a body standing for $1$ expressed |
| by the CMO. |
by the CMO. |
| The server translates {\tt (CMO\_ZZ, 1)} to its internal object of |
The server translates {\tt (CMO\_ZZ,1)} to its internal object for |
| the integer $1$ |
the integer $1$ |
| and pushes the object onto the stack. |
and pushes the object onto the stack. |
| |
|
| If the server gets an {\it OX command} message, then the server |
If the server gets an {\it OX command} message, then the server |
| executes the command. |
executes the command. |
| Any OX command message starts with the int32 tag OX\_COMMAND. |
Any OX command message starts with the int32 tag {\tt OX\_COMMAND}. |
| The body is a stack machine operation code expressed by int32. |
The body is a stack machine operation code expressed by int32. |
| %The codes are listed below \cite{ox-rfc-100}. |
%The codes are listed below \cite{ox-rfc-100}. |
| %\begin{verbatim} |
%\begin{verbatim} |
| Line 64 is pushed as a string. |
|
| Line 64 is pushed as a string. |
|
| Finally, the stack machine command |
Finally, the stack machine command |
| {\tt SM\_executeFunction} evaluates the operator and |
{\tt SM\_executeFunction} evaluates the operator and |
| pushes the result onto the stack |
pushes the result onto the stack |
| after poping the operator name, the number of arguments |
after popping the operator name, the number of arguments, |
| and arguments. |
and arguments. |
| %For example, the following code factorizes $x^{100}-1$ by calling |
%For example, the following code factorizes $x^{100}-1$ by calling |
| %{\tt ox\_asir} from Asir. |
%{\tt ox\_asir} from Asir. |
| Line 87 instead of a result of the computation. |
|
| Line 87 instead of a result of the computation. |
|
| %error([8,fctr : invalid argument]) |
%error([8,fctr : invalid argument]) |
| %\end{verbatim} |
%\end{verbatim} |
| |
|
| OpenXM server won't send error messages to the client |
OpenXM server does not send error messages to the client |
| except when it receives a {\tt SM\_pop*} command. |
except when it receives a {\tt SM\_pop*} command, |
| |
which is a request to pop data from the stack and to write it to the client. |
| OX stack machines work in the asynchronous mode which is similar |
OX stack machines work in the asynchronous mode which is similar |
| to X servers. |
to X servers. |
| %For servers of graphic and sound applications, |
%For servers of graphic and sound applications, |