Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/MLRISC/Doc/latex/asm.tex
ViewVC logotype

View of /sml/trunk/src/MLRISC/Doc/latex/asm.tex

Parent Directory Parent Directory | Revision Log Revision Log

Revision 651 - (download) (as text) (annotate)
Thu Jun 1 18:34:03 2000 UTC (19 years, 2 months ago) by monnier
File size: 1993 byte(s)
bring revisions from the vendor branch to the trunk

Assemblers in MLRISC satisfy the signature 
which is defined as:
   structure I : \href{instructions.html}{INSTRUCTIONS}
   structure C : \href{cells.html}{CELLS}
   structure S : \href{streams.html}{INSTRUCTION_STREAM}
   structure P : \href{pseudo-ops.html}{PSEUDO_OPS}
      sharing I.C = C
      sharing S.P = P

   val makeStream : Annotations.annotations ->
                     ((int -> int) -> I.instruction -> unit,
                      unit,'b,'c,'d,'e) S.stream

The function \sml{makeStream} returns an instruction stream.
By default the output is bound to the stream \sml{AsmStream.asmOutStream} 
defined in the structure 
\mlrischref{emit/asmStream.sml}{AsmStream} at creation time.

The structure \sml{AsmStream} satisfy the following signature.
signature ASM_STREAM = sig
  val asmOutStream : TextIO.outstream ref
  val withStream : TextIO.outstream -> ('a -> 'b) -> 'a -> 'b
\subsubsection{Redirecting the Output}
It is possible to redirect the output of an instruction stream.
For example, the following statement
   val asm = makeStream []
binds the output of \sml{asm} to \sml{AsmStream.asmOutStream}, which
by default is just \sml{TextIO.stdOut}.  On the other hand, the
   val asm = AsmStream.withStream mystream makeStream []
binds the output of asm to \sml{mystream}.

\subsubsection{More Details}

Assemblers are automatically generated by the 
\href{mlrisc-md.html}{MDGen} tool.  Some specific generated
assemblers are listed below:
 \item \mlrischref{sparc/emit/sparcAsm.sml}{Sparc}
 \item \mlrischref{hppa/emit/hppaAsm.sml}{Hppa}
 \item \mlrischref{alpha/emit/alphaAsm.sml}{Alpha}
 \item \mlrischref{ppc/emit/ppcAsm.sml}{Power PC}
 \item \mlrischref{x86/emit/x86Asm.sml}{X86}

ViewVC Help
Powered by ViewVC 1.0.0