|
|
Assemblers
Overview
Assemblers in MLRISC satisfy the signature
INSTRUCTION_EMITTER,
which is defined as:
signature INSTRUCTION_EMITTER =
sig
structure I : INSTRUCTIONS
structure C : CELLS
structure S : INSTRUCTION_STREAM
structure P : 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
end
The function makeStream returns an instruction stream.
By default the output is bound to the stream AsmStream.asmOutStream
defined in the structure
AsmStream at creation time.
The structure AsmStream satisfy the following signature.
signature ASM_STREAM = sig
val asmOutStream : TextIO.outstream ref
val withStream : TextIO.outstream -> ('a -> 'b) -> 'a -> 'b
end
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 asm to AsmStream.asmOutStream, which
by default is just TextIO.stdOut. On the other hand, the
statement
val asm = AsmStream.withStream mystream makeStream []
binds the output of asm to mystream.
More Details
Assemblers are automatically generated by the
MDGen tool. Some specific generated
assemblers are listed below:
- Sparc
- Hppa
- Alpha
- Power PC
- X86
|
|
Generated by
mltex2html
|
Last modified: Mon Jun 8 14:18:05 UTC 2009 by buildd@vernadsky
|
|