Class SVM_LOADA
java.lang.Object
svm.instruction.SVM_Instruction
svm.instruction.SVM_LOADA
SVM-INSTRUCTION: LOADA objadr size
Runtime Stack
..., oaddr(?), offset(?), index(?) →
..., resadr, ofst
First, if the 'objadr.indexed' flag is set, the 'index' is popped off the Runtime stack and added to 'offset'.
Then Force 'objadr' unstacked. Ie. pop off any stacked part and form the resulting address 'resadr'.
The unstacking of the 'objadr' depend on its address kind:
- REMOTE_ADDR: object address 'oaddr' is popped of the Runtime stack.
resadr := oaddr + objadr.offset
- REFER_ADDR: 'offset' and object address 'oaddr' is popped of the Runtime stack.
resadr := oaddr + objadr.offset + offset
- Otherwise: resadr := objadr
Finally, 'resadr' and 'offset' are pushed onto the Runtime stack.
Link to GitHub: Source File.
- Author:
- S-Port: Definition of S-code, Øystein Myhre Andersen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ObjectAddressThe object addressprivate final intThe extra offsetFields inherited from class SVM_Instruction
iADD, iADDREG, iAND, iASSIGN, iCALL, iCALLSYS, iCOMPARE, iCONVERT, iDECO, iDIST, iDIV, iDUP, iENTER, iEQV, iGETO, iGOTO, iIMP, iINCO, iINITO, iJUMP, iJUMPIF, iLINE, iLOAD, iLOADA, iMax, iMULT, iNEG, iNOOP, iNOT, iOR, iPOPK, iPRECALL, iPUSHC, iPUSHLEN, iPUSHR, iREM, iRESTORE, iRETURN, iSAVE, iSETO, iSHIFT, iSTORE, iSUB, iSWITCH, iXOR, opcode -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConstruct an SVM_LOADA instruction from the given input.SVM_LOADA(ObjectAddress objadr, int offset) Construct a new SVM_LOADA instruction -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Execute this SVM instructionstatic SVM_LOADAread(AttributeInputStream inpt) Reads an SVM_LOADA instruction from the given input.toString()voidwrite(AttributeOutputStream oupt) Write this SVM instruction to the given output.Methods inherited from class SVM_Instruction
edOpcode, readObject
-
Field Details
-
objadr
The object address -
offset
private final int offsetThe extra offset
-
-
Constructor Details
-
SVM_LOADA
Construct a new SVM_LOADA instruction- Parameters:
objadr- the object addressoffset- the extra offset
-
SVM_LOADA
Construct an SVM_LOADA instruction from the given input.- Parameters:
inpt- the input stream- Throws:
IOException- if IOException occur
-
-
Method Details
-
execute
public void execute()Description copied from class:SVM_InstructionExecute this SVM instruction- Overrides:
executein classSVM_Instruction
-
toString
-
write
Description copied from class:SVM_InstructionWrite this SVM instruction to the given output.- Overrides:
writein classSVM_Instruction- Parameters:
oupt- the output stream- Throws:
IOException- if IOException occur
-
read
Reads an SVM_LOADA instruction from the given input.- Parameters:
inpt- the input stream- Returns:
- the SVM_LOADA instruction read
- Throws:
IOException- if IOException occur
-