Class ObjectAddress
java.lang.Object
svm.value.Value
svm.value.ObjectAddress
- Author:
- S-Port: Definition of S-code, /** Address kind */ ystein Myhre Andersen
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanSignals 'indexed' address.intAddress kindintAddress offsetstatic final intAddress kindstatic final intAddress kindstatic final intAddress kindSegment ident when kind SEGMNT_ADDRstatic final intAddress kindstatic final intAddress kind -
Constructor Summary
ConstructorsModifierConstructorDescriptionDefault ConstructorprotectedObjectAddress(int kind, String segID, int ofst, boolean indexed) Construct a new ObjectAddress with the given parameters -
Method Summary
Modifier and TypeMethodDescriptionReturns the result of: this value + other valueaddOffset(int ofst) Increment the offset part by the given ofstbooleanCompare this Value with the given Value according to the given relation.copy()Returns a copy of this ObjectAddressvoidDebug utility: dumpAreavoidemit(DataSegment dseg) Add this value to the given DataSegmentvoidfixupAddress(ObjectAddress oaddr) Fixup this ObjectAddress by the given addressload(int idx) Load a value from memory address: this ObectAddress + idxstatic ObjectAddressofFixup()Create a new Fixup address.static ObjectAddressCreate a new Refer address.static ObjectAddressofRelFrameAddr(int ofst) Create a new Relative address with the given offsetstatic ObjectAddressCreate a new Remote address.static ObjectAddressofScode()Scans the remaining S-Code (if any) belonging to this ObjectAddress Value.static ObjectAddressCreate a new Segment address with the given parametersstatic ObjectAddressofSegAddr(DataSegment seg, int ofst) Create a new Segment address with the given parametersstatic ObjectAddressread(AttributeInputStream inpt) Reads a ObjectAddress from the given input.segment()Returns the DataSegment part of a Segment AddressvoidStore the given value into memory address: this ObectAddress + idxReturns the result of: this value - other valueForce 'objadr' unstacked.If this ObjectAddress is a Relative Address it is converted to a absolute Stack Address.toString()voidwrite(AttributeOutputStream oupt) Writes this Value to the given output.voidWrites the body of this ObjectAddress to the given output.
-
Field Details
-
kind
public int kindAddress kind -
segID
Segment ident when kind SEGMNT_ADDR -
ofst
public int ofstAddress offset -
indexed
public boolean indexedSignals 'indexed' address. In that case an index offset is pushed to the runtime stack. -
SEGMNT_ADDR
public static final int SEGMNT_ADDRAddress kind- See Also:
-
REMOTE_ADDR
public static final int REMOTE_ADDRAddress kind- See Also:
-
REFER_ADDR
public static final int REFER_ADDRAddress kind- See Also:
-
REL_ADDR
public static final int REL_ADDRAddress kind- See Also:
-
STACK_ADDR
public static final int STACK_ADDRAddress kind- See Also:
-
-
Constructor Details
-
ObjectAddress
public ObjectAddress()Default Constructor -
ObjectAddress
Construct a new ObjectAddress with the given parameters- Parameters:
kind- the address kindsegID- the Segment ident when kind SEGMNT_ADDRofst- The offsetindexed- Signals 'indexed' address. In that case an index offset is pushed to the runtime stack.
-
-
Method Details
-
ofScode
Scans the remaining S-Code (if any) belonging to this ObjectAddress Value. Then construct a new ObjectAddress instance.- Returns:
- that ObjectAddress instance.
-
ofSegAddr
Create a new Segment address with the given parameters- Parameters:
segID- the Segment identofst- The offset- Returns:
- an ObjectAddress
-
ofSegAddr
Create a new Segment address with the given parameters- Parameters:
seg- the Segmentofst- The offset- Returns:
- an ObjectAddress
-
ofRemoteAddr
-
ofReferAddr
-
ofRelFrameAddr
Create a new Relative address with the given offset- Parameters:
ofst- The offset- Returns:
- an ObjectAddress
-
ofFixup
-
segment
Returns the DataSegment part of a Segment Address- Returns:
- the DataSegment part of a Segment Address
-
copy
-
addOffset
Increment the offset part by the given ofst- Parameters:
ofst- the ofst to be added- Returns:
- the resulting ObjectAddress
-
fixupAddress
Fixup this ObjectAddress by the given address- Parameters:
oaddr- an Object address
-
toStackAddress
If this ObjectAddress is a Relative Address it is converted to a absolute Stack Address.- Returns:
- an ObjectAddress possibly converted
-
toRTMemAddr
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
- Returns:
- resadr as calculated
-
emit
Description copied from class:ValueAdd this value to the given DataSegment -
store
Store the given value into memory address: this ObectAddress + idx- Parameters:
idx- the index to usevalue- the value to be stored
-
load
Load a value from memory address: this ObectAddress + idx- Parameters:
idx- the index to use- Returns:
- value the value loaded
-
add
-
sub
-
compare
Description copied from class:ValueCompare this Value with the given Value according to the given relation. -
dumpArea
Debug utility: dumpArea- Parameters:
title- the title of the dump printoutlng- the length of the dump
-
toString
-
write
Description copied from class:ValueWrites this Value to the given output.- Overrides:
writein classValue- Parameters:
oupt- the output stream- Throws:
IOException- if IOException occur
-
writeBody
Writes the body of this ObjectAddress to the given output.- Parameters:
oupt- the output stream- Throws:
IOException- if IOException occur
-
read
Reads a ObjectAddress from the given input.- Parameters:
inpt- the AttributeInputStream- Returns:
- the ObjectAddress read
- Throws:
IOException- if IOException occur
-