Class SVM_ASSIGN


public class SVM_ASSIGN extends SVM_Instruction

SVM-INSTRUCTION: ASSIGN and UPDATE

ASSIGN objadr size

Runtime Stack ..., oaddr(?), offset(?), index(?), value1, value2, ... , value'size → ...

UPDATE objadr size

Runtime Stack ..., oaddr(?), offset(?), index(?), value1, value2, ... , value'size → ..., value1, value2, ... , value'size

First, the values are popped off the Runtime stack and remembered.
Then, 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 remembered values are successively stored in address resadr, resadr+1, ... and upwards
and, if UPDATE operation, the values are pushed back onto the Runtime stack.

Link to GitHub: Source File.

Author:
S-Port: Definition of S-code, Øystein Myhre Andersen
  • Field Details

    • update

      private final boolean update
      true:UPDATE, otherwise ASSIGN instruction
    • objadr

      private final ObjectAddress objadr
      The target address
    • size

      private final int size
      The value size
  • Constructor Details

    • SVM_ASSIGN

      public SVM_ASSIGN(boolean update, ObjectAddress objadr, int size)
      Construct a new SVM_ASSIGN instruction
      Parameters:
      update - true:UPDATE, otherwise ASSIGN instruction
      objadr - the target address
      size - the value size
    • SVM_ASSIGN

      private SVM_ASSIGN(AttributeInputStream inpt) throws IOException
      Construct an SVM_ASSIGN instruction from the given input.
      Parameters:
      inpt - the input stream
      Throws:
      IOException - if IOException occur
  • Method Details