|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.backend.Assembler scale.backend.xyz.XyzAssembler
public final class XyzAssembler
This class generates Xyz assembly language from a list of Xyz instructions.
$Id: XyzAssembler.java,v 1.1 2006-11-16 17:28:18 burrill Exp $
Copyright 2006 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
This class generates the assembly language for this architecture from the instructions for this architecture. Most of the methods below generate a "not implemented error". These must be replaced with code that generates the proper assemblylanguage sequence. The other methods may need to be modified. Use the assembler classes from the other architectures to help you understand how to make changes for your architecture.
Assembler
,
AlphaAssembler
,
SparcAssembler
,
PPCAssembler
Field Summary |
---|
Fields inherited from class scale.backend.Assembler |
---|
gen, hex, oneItemPerLine, repsAllowedInAL, source |
Constructor Summary | |
---|---|
XyzAssembler(Generator gen,
java.lang.String source,
boolean instructionScheduling)
|
Method Summary | |
---|---|
void |
assembleComment(java.lang.String comment,
Emit emit)
Insert the assembler representation of the comment into the output stream. |
long |
assembleData(Emit emit,
SpaceAllocation sa,
long location)
Called for each allocation in a named area. |
void |
assembleDataAreaHeader(Emit emit,
int kind)
Generate the assembly directives for each different kind of data area. |
void |
assembleEpilog(Emit emit)
Called at the very end of generating assembly code. |
void |
assembleLabel(Label label,
Emit emit)
Generate a label in the assembly output. |
void |
assembleProlog(Emit emit)
Called at the very beginning of generating assembly code. |
java.lang.String |
assembleRegister(int reg)
Convert a register number into its assembly language form. |
protected void |
genAsciiText(Emit emit,
java.lang.String str)
Generate the assembly directive required to generate an ASCII text string. |
protected void |
genBytes(Emit emit,
int numBytes,
long data,
int reps)
Output an integer data item as a string of bytes. |
protected long |
genData(Emit emit,
int dt,
Label lab,
int reps,
boolean aligned)
Generate the data representation for address of the label. |
protected void |
genDirective(Emit emit,
int dt)
Generate the assembly directive required for the type. |
protected void |
genZeroFill(Emit emit,
long size)
Generate the assembly directive required to generate a zero-filled area. |
protected int |
getDirectiveSize(int dt)
Return the number of addressable units required for one value of the specified type. |
java.lang.String |
getLabelString(Label label)
Return the String representing the label. |
Methods inherited from class scale.backend.Assembler |
---|
assemble, assembleDataBegin, assembleDataEnd, assembleInstructions, genData, genData, genData, genData, genData, genData, genData, genData, genData, genData, getDisplayString, getName, getSourceLanguage, getSpaceAllocation, isFortran |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XyzAssembler(Generator gen, java.lang.String source, boolean instructionScheduling)
gen
- is the instruction generator used to generate the instructions.source
- specifies the source programMethod Detail |
---|
public void assembleProlog(Emit emit)
Assembler
assembleProlog
in class Assembler
public void assembleEpilog(Emit emit)
Assembler
assembleEpilog
in class Assembler
public java.lang.String getLabelString(Label label)
Assembler
getLabelString
in class Assembler
public void assembleLabel(Label label, Emit emit)
Assembler
assembleLabel
in class Assembler
public void assembleComment(java.lang.String comment, Emit emit)
Assembler
assembleComment
in class Assembler
public java.lang.String assembleRegister(int reg)
Assembler
assembleRegister
in class Assembler
public void assembleDataAreaHeader(Emit emit, int kind)
Assembler
assembleDataAreaHeader
in class Assembler
emit
- is the output sinkkind
- specifies the area kindprotected void genDirective(Emit emit, int dt)
Assembler
genDirective
in class Assembler
emit
- specifies where to put the directive.dt
- - the data typeSpaceAllocation
protected int getDirectiveSize(int dt)
Assembler
getDirectiveSize
in class Assembler
dt
- - the data typeSpaceAllocation
protected void genZeroFill(Emit emit, long size)
Assembler
genZeroFill
in class Assembler
emit
- specifies where to put the directive.size
- is the number of bytes of zeros requiredSpaceAllocation
protected void genAsciiText(Emit emit, java.lang.String str)
Assembler
genAsciiText
in class Assembler
emit
- specifies where to put the directive.str
- is the stringprotected void genBytes(Emit emit, int numBytes, long data, int reps)
Assembler
genBytes
in class Assembler
emit
- specifies where to generate the datanumBytes
- is the number of bytes of datadata
- is the data to be outputreps
- is the number of times to repeat the dataprotected long genData(Emit emit, int dt, Label lab, int reps, boolean aligned)
Assembler
genData
in class Assembler
emit
- specifies where to generate the datadt
- specifies the data typelab
- is the labelreps
- specifies how many times to generate the representationaligned
- specifies whether the data will be aligned
SpaceAllocation
public long assembleData(Emit emit, SpaceAllocation sa, long location)
Assembler
assembleData
in class Assembler
emit
- is the output sinksa
- is the data spacelocation
- is the current location
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |