Class SVM_JUMPIF
java.lang.Object
svm.instruction.SVM_Instruction
svm.instruction.SVM_JUMP
svm.instruction.SVM_JUMPIF
SVM-INSTRUCTION: JUMPIF relation size paddr
Runtime Stack
..., sos, tos →
...
The 'tos' and 'sos' are popped off the Runtime stack. The 'result' is calculated as result = sos relation tos. Note: Both 'tos' abd 'sos' may be multi-sized.
Conditional Jump to paddr.
A conditional jump is executed, branching only if the relation evaluates true. Ie. The Program Sequence Control PCS := paddr otherwise PCS is incremented by one.
Link to GitHub: Source File.
- Author:
- S-Port: Definition of S-code, Øystein Myhre Andersen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RelationThe relationprivate final intThe test value sizeFields inherited from class SVM_JUMP
destinationFields 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
ConstructorsModifierConstructorDescriptionSVM_JUMPIF(Relation relation, int size, ProgramAddress destination) Construct a new SVM_JUMP instructionprivateConstruct an SVM_JUMPIF instruction from the given input. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Execute this SVM instructionstatic SVM_Instructionread(AttributeInputStream inpt) Reads an SVM_JUMPIF instruction from the given input.toString()voidwrite(AttributeOutputStream oupt) Write this SVM instruction to the given output.Methods inherited from class SVM_JUMP
setDestinationMethods inherited from class SVM_Instruction
edOpcode, readObject
-
Field Details
-
relation
The relation -
size
private final int sizeThe test value size
-
-
Constructor Details
-
SVM_JUMPIF
Construct a new SVM_JUMP instruction- Parameters:
relation- the relationsize- the test value sizedestination- the jump destination address
-
SVM_JUMPIF
Construct an SVM_JUMPIF instruction from the given input.- Parameters:
inpt- the input stream- Throws:
IOException- if IOException occur
-
-
Method Details
-
execute
-
toString
-
write
Description copied from class:SVM_InstructionWrite this SVM instruction to the given output.- Overrides:
writein classSVM_JUMP- Parameters:
oupt- the output stream- Throws:
IOException- if IOException occur
-
read
Reads an SVM_JUMPIF instruction from the given input.- Parameters:
inpt- the input stream- Returns:
- the SVM_JUMPIF instruction read
- Throws:
IOException- if IOException occur
-