Class MetaAddressingMode

  • All Implemented Interfaces:
    MetaData

    public class MetaAddressingMode
    extends java.lang.Object
    implements MetaData
    The MetaAddressingMode class holds information on the specified addressing mode.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected MetaAddressingMode​(java.lang.String name, Type dataType, boolean label, boolean exception, boolean memoryReference, boolean load, boolean store, int blockSize)  
        MetaAddressingMode​(java.lang.String name, Type dataType, java.util.Map<java.lang.String,​MetaArgument> args, boolean label, boolean exception, boolean memoryReference, boolean load, boolean store, int blockSize)
      Constructs a metadata object for an addressing mode.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addArgument​(MetaArgument argument)  
      boolean canThrowException()
      Checks whether the addressing mode (its attributes) can throw an exception.
      MetaArgument getArgument​(java.lang.String name)
      Return an argument of the given addressing mode that has the specified name.
      java.util.Collection<java.lang.String> getArgumentNames()
      Returns the list of addressing mode argument.
      java.util.Collection<MetaArgument> getArguments()
      Returns a collection of addressing mode arguments.
      int getBlockSize()
      Returns the size of block read or written to memory.
      Type getDataType()
      Returns the type of data accessed via the addressing mode.
      java.lang.String getName()
      Returns the name of the addressing mode.
      boolean isArgumentDefined​(java.lang.String name)
      Checks whether the addressing mode has an argument with the specified name.
      boolean isLabel()
      Checks whether the addressing mode computes an immediate value from a label.
      boolean isLoad()
      Checks whether the addressing performs a memory load action in its attributes.
      boolean isMemoryReference()
      Checks whether the addressing mode provides refers to memory (provides an access to memory via its return expression).
      boolean isStore()
      Checks whether the addressing mode performs a memory store action.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MetaAddressingMode

        public MetaAddressingMode​(java.lang.String name,
                                  Type dataType,
                                  java.util.Map<java.lang.String,​MetaArgument> args,
                                  boolean label,
                                  boolean exception,
                                  boolean memoryReference,
                                  boolean load,
                                  boolean store,
                                  int blockSize)
        Constructs a metadata object for an addressing mode.
        Parameters:
        name - Addressing mode name.
        dataType - the type of data accessed via the addressing mode.
        args - Table of addressing mode arguments.
        label - true if the addressing mode computes an immediate value from a label or false otherwise.
        exception - true if the addressing mode can throw an exception or false otherwise.
        memoryReference - true if the addressing mode provides access to memory or false otherwise.
        load - true if the addressing mode performs a memory load action or false otherwise.
        store - true if the addressing mode performs a memory store action or false otherwise.
        blockSize - Size of loaded/stored memory block in bits.
        Throws:
        java.lang.IllegalArgumentException - if any of the parameters is null.
      • MetaAddressingMode

        protected MetaAddressingMode​(java.lang.String name,
                                     Type dataType,
                                     boolean label,
                                     boolean exception,
                                     boolean memoryReference,
                                     boolean load,
                                     boolean store,
                                     int blockSize)
    • Method Detail

      • addArgument

        protected final void addArgument​(MetaArgument argument)
      • getName

        public final java.lang.String getName()
        Returns the name of the addressing mode.
        Specified by:
        getName in interface MetaData
        Returns:
        Mode name.
      • getDataType

        public final Type getDataType()
        Returns the type of data accessed via the addressing mode.
        Specified by:
        getDataType in interface MetaData
        Returns:
        Data type.
      • getArguments

        public final java.util.Collection<MetaArgument> getArguments()
        Returns a collection of addressing mode arguments.
        Returns:
        Collection of addressing mode arguments.
      • getArgument

        public final MetaArgument getArgument​(java.lang.String name)
        Return an argument of the given addressing mode that has the specified name.
        Parameters:
        name - Argument name.
        Returns:
        Argument with the specified name or null if no such argument is defined.
      • getArgumentNames

        public final java.util.Collection<java.lang.String> getArgumentNames()
        Returns the list of addressing mode argument.
        Returns:
        Collection of argument names.
      • isArgumentDefined

        public final boolean isArgumentDefined​(java.lang.String name)
        Checks whether the addressing mode has an argument with the specified name.
        Parameters:
        name - Argument name.
        Returns:
        true if the argument is defined of false otherwise.
      • isLabel

        public final boolean isLabel()
        Checks whether the addressing mode computes an immediate value from a label.
        Returns:
        true if the addressing mode computes an immediate value from a label or false otherwise.
      • canThrowException

        public final boolean canThrowException()
        Checks whether the addressing mode (its attributes) can throw an exception.
        Returns:
        true if the addressing mode can throw an exception or false otherwise.
      • isMemoryReference

        public final boolean isMemoryReference()
        Checks whether the addressing mode provides refers to memory (provides an access to memory via its return expression).
        Returns:
        true if the addressing mode provides an reference to memory or false otherwise.
      • isLoad

        public final boolean isLoad()
        Checks whether the addressing performs a memory load action in its attributes. This does not apply to the return expression, for which the isMemoryReference must be used.
        Returns:
        true if the addressing mode performs a memory load action or false otherwise.
      • isStore

        public final boolean isStore()
        Checks whether the addressing mode performs a memory store action. This does not apply to the return expression, for which the isMemoryReference must be used.
        Returns:
        true if the addressing mode performs a memory store action or false otherwise.
      • getBlockSize

        public final int getBlockSize()
        Returns the size of block read or written to memory. Applicable for load or store operations.
        Returns:
        Size of memory block in bits.
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object