|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--scale.backend.Assembler
This class is the base class for classes that translate instructions into assembly language.
$Id: Assembler.java,v 1.9 2002/01/03 21:41:28 burrill Exp $
Copyright 2002 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
| Field Summary | |
protected Generator |
gen
The Generator used to generate the instructions. |
static char[] |
hex
Convert an integer from 0 to 15 to a hex digit. |
protected java.lang.String |
source
The source file name. |
| Constructor Summary | |
Assembler(Generator gen,
java.lang.String source)
Convert the Scribble CFG to instructions. |
|
| Method Summary | |
void |
assemble(Emit emit,
SpaceAllocation[] dataAreas)
Generate assembly code for the data areas. |
abstract int |
assembleData(Emit emit,
SpaceAllocation sa,
int location)
Called for each allocation in a named area. |
abstract void |
assembleDataAreaHeader(Emit emit,
int kind)
Generate the assembly directives for each different kind of data area. |
protected void |
assembleDataBegin(Emit emit,
SpaceAllocation sa,
int location)
Called when a named area is started. |
protected void |
assembleDataEnd(Emit emit,
SpaceAllocation sa,
int location)
Called when a named area is ended. |
abstract void |
assembleEpilog(Emit emit)
Called at the very end of generating assembly code. |
abstract void |
assembleInstruction(Instruction inst,
Emit emit)
Generate an assembly instruction |
protected void |
assembleInstructions(Emit emit,
java.lang.String name,
Instruction firstInstruction)
Generate assembly instructions for the list of instructions. |
abstract void |
assembleLabel(int label,
Emit emit)
Generate a label in the assembly output. |
abstract void |
assembleProlog(Emit emit)
Called at the very beginning of generating assembly code. |
abstract java.lang.String |
assembleRegister(int reg)
Convert a register number into its assembly language form. |
java.lang.String |
getDisplayString(byte[] v,
int start,
int end)
Convert a string to a form suitable for display. |
abstract java.lang.String |
getLabelString(int label)
Return the String representing the label. |
java.lang.String |
getName(int handle)
Return the name associated with an area handle. |
SourceLanguage |
getSourceLanguage()
Return the source language of the original program. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final char[] hex
protected Generator gen
Generatorprotected java.lang.String source
| Constructor Detail |
public Assembler(Generator gen,
java.lang.String source)
gen - is the generator used to generate the instructionssource - is the source file name| Method Detail |
public java.lang.String getName(int handle)
public final void assemble(Emit emit,
SpaceAllocation[] dataAreas)
protected void assembleInstructions(Emit emit,
java.lang.String name,
Instruction firstInstruction)
name - is the associated routine namefirstInstruction - is the head of the list of instructionspublic final SourceLanguage getSourceLanguage()
public abstract java.lang.String getLabelString(int label)
public abstract void assembleProlog(Emit emit)
public abstract void assembleEpilog(Emit emit)
public abstract void assembleLabel(int label,
Emit emit)
public abstract java.lang.String assembleRegister(int reg)
public abstract void assembleInstruction(Instruction inst,
Emit emit)
public abstract void assembleDataAreaHeader(Emit emit,
int kind)
emit - is the output sinkkind - specifies the area kind
protected void assembleDataBegin(Emit emit,
SpaceAllocation sa,
int location)
emit - is the output sinksa - is the data spacelocation - is the current location
public abstract int assembleData(Emit emit,
SpaceAllocation sa,
int location)
emit - is the output sinksa - is the data spacelocation - is the current location
protected void assembleDataEnd(Emit emit,
SpaceAllocation sa,
int location)
emit - is the output sinksa - is the data spacelocation - is the current location
public java.lang.String getDisplayString(byte[] v,
int start,
int end)
v - the original string
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||