Class SVM_STORE
java.lang.Object
svm.instruction.SVM_Instruction
svm.instruction.SVM_STORE
SVM-INSTRUCTION: STORE objadr size
Runtime Stack
..., value1, value2, ... , value'size, oaddr(?), offset(?), index(?) →
..., value1, value2, ... , value'size
First, the values are popped off the Runtime stack and remembered.
If the 'objadr.indexed' flag is set, the 'index' is popped off and added to 'objadr'.
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, the values are successively stored in address resadr, resadr+1, ... and upwards
without removing them from 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 target addressprivate final intThe value sizeFields 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 SVM_STORE instruction from the given input.SVM_STORE(ObjectAddress objadr, int size) Construct a new SVM_STORE instruction -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Execute this SVM instructionstatic SVM_Instructionread(AttributeInputStream inpt) Reads an SVM_STORE 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 target address -
size
private final int sizeThe value size
-
-
Constructor Details
-
SVM_STORE
Construct a new SVM_STORE instruction- Parameters:
objadr- the target addresssize- the value size
-
SVM_STORE
Construct SVM_STORE 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_STORE instruction from the given input.- Parameters:
inpt- the input stream- Returns:
- the SVM_STORE instruction read
- Throws:
IOException- if IOException occur
-