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/asm.html
ViewVC logotype

View of /sml/trunk/src/MLRISC/Doc/asm.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 499 - (download) (as text) (annotate)
Tue Dec 7 15:44:50 1999 UTC (20 years, 3 months ago) by monnier
File size: 2392 byte(s)
This commit was generated by cvs2svn to compensate for changes in r498,
which included commits to RCS files with non-trunk default branches.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="GENERATOR" CONTENT="Mozilla/4.07 [en] (X11; I; Linux 2.2.7 i686) [Netscape]">
</HEAD>
<BODY bgcolor="#FFFFFF">

<CENTER>
<H1>
<FONT COLOR="#aa0000">Assemblers</FONT></H1></CENTER>

<h3> Overview </h3>
Assemblers in MLRISC satisfy the signature 
<a href="../emit/instruction-emitter.sig" target=code>INSTRUCTION_EMITTER</a>,
which is defined as:
<pre>
signature INSTRUCTION_EMITTER =
sig

   structure I : <a href="instructions.html">INSTRUCTIONS</a>
   structure C : <a href="cells.html">CELLS</a>
   structure S : <a href="streams.html">INSTRUCTION_STREAM</a>
   structure P : <a href="pseudo-ops.html">PSEUDO_OPS</a>
      sharing I.C = C  
      sharing S.P = P

   val makeStream : Annotations.annotation list -> 
          (I.instruction,'a,'b) S.stream
end
</pre>

The function <tt>makeStream</tt> returns an instruction stream.
By default the output is bound to the stream <tt>AsmStream.asmOutStream</tt> 
defined in the structure 
<a href="../emit/asmStream.sml" target=code> AsmStream</a> at creation time.
<p>
The structure <tt>AsmStream</tt> satisfy the following signature.
<pre>
signature ASM_STREAM = sig
  val asmOutStream : TextIO.outstream ref
  val withStream : TextIO.outstream -> ('a -> 'b) -> 'a -> 'b
end
</pre>
<h3> Redirecting the Output </h3>
It is possible to redirect the output of an instruction stream.
For example, the following statement
<small>
<pre>
   val asm = makeStream []
</pre>
</small>
binds the output of <tt>asm</tt> to <tt>AsmStream.asmOutStream</tt>, which
by default is just <tt>TextIO.stdOut</tt>.  On the other hand, the
statement
<small>
<pre>
   val asm = AsmStream.withStream mystream makeStream []
</pre>
</small>
binds the output of asm to <tt>mystream</tt>.

<h3> More Details </h3>

Assemblers are automatically generated by the 
<a href="../MD++/md.html"> MDGen </a> tool.  Some specific generated
assemblers are listed below:
<ul>
 <li> <a href="../sparc/emit/sparcAsm.sml" target=code> Sparc </a>
 <li> <a href="../hppa/emit/hppaAsm.sml" target=code> Hppa </a>
 <li> <a href="../alpha/emit/alphaAsm.sml" target=code> Alpha </a>
 <li> <a href="../ppc/emit/ppcAsm.sml" target=code> Power PC </a>
 <li> <a href="../x86/emit/x86Asm.sml" target=code> X86 </a>
</ul>

<HR>
</BODY>
</HTML>

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0