org.kiama.example.RISC

RISCISA

object RISCISA

Instruction set architecture for a simple RISC machine.

Source
RISCISA.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RISCISA
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. case class ADD(a: RegNo, b: RegNo, c: RegNo) extends Instr with Product with Serializable

    Add the values in registers b and c, store the result in register a.

  2. case class ADDI(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Add the value in register b and the value im, store the result in register a.

  3. case class AND(a: RegNo, b: RegNo, c: RegNo) extends Instr with Product with Serializable

    Bitwise AND the values in registers b and c, store the (integer) remainder in register a.

  4. case class ANDI(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Bitwise AND the value in registers b and the value im, store the (integer) remainder in register a.

  5. type AssemCode = Seq[Assembler]

    An assembler code sequence.

    An assembler code sequence. Includes comments and labels.

  6. sealed abstract class Assembler extends AnyRef

    Machine instructions.

  7. case class BEQ(label: Label) extends Branch with Product with Serializable

    If the Z condition code is set, set the program counter to its value plus four times disp.

  8. case class BGE(label: Label) extends Branch with Product with Serializable

    If the N condition code is clear, set the program counter to its value plus four times disp.

  9. case class BGT(label: Label) extends Branch with Product with Serializable

    If both of the Z and N condition codes are clear, set the program counter to its value plus four times disp.

  10. case class BLE(label: Label) extends Branch with Product with Serializable

    If either of the Z or N condition codes is set, set the program counter to its value plus four times disp.

  11. case class BLT(label: Label) extends Branch with Product with Serializable

    If the N condition code is set, set the program counter to its value plus four times disp.

  12. case class BNE(label: Label) extends Branch with Product with Serializable

    If the Z condition code is clear, set the program counter to its value plus four times disp.

  13. case class BR(label: Label) extends Branch with Product with Serializable

    Set the program counter to its value plus disp.

  14. case class BSR(label: Label) extends Branch with Product with Serializable

    Set R31 to the value of the program counter plus one.

  15. sealed abstract class Branch extends Instr

    Common type for all branch instructions.

  16. case class CHKI(b: RegNo, im: Imm) extends Instr with Product with Serializable

    If register a contains a value that is negative or greater than or equal to the value im, set register a to zero.

  17. case class CMP(b: RegNo, c: RegNo) extends Instr with Product with Serializable

    Set the Z condition code if the contents of registers b and c are equal.

  18. case class CMPI(b: RegNo, im: Imm) extends Instr with Product with Serializable

    Set the Z condition code if the content of register b and the value im are equal, otherwise clear Z.

  19. type Code = Seq[Instr]

    A machine code sequence.

  20. case class Comment(text: String) extends Pseudo with Product with Serializable

    Comment.

  21. case class DIV(a: RegNo, b: RegNo, c: RegNo) extends Instr with Product with Serializable

    Divide the values in registers b and c, store the (integer) result in register a.

  22. case class DIVI(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Divide the value in register b and the value im, store the (integer) result in register a.

  23. type Disp = Int

  24. type Imm = Short

    Operand types

  25. sealed abstract class Instr extends Assembler

  26. case class LDB(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Load register a with the byte value stored in memory at the address given by the contents of register b plus the value im.

  27. case class LDW(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Load register a with the word value stored in memory at the address given by the contents of register b plus the value im.

  28. case class Label(num: Int, disp: Int = -1) extends Instr with Product with Serializable

    Branch target labels.

  29. case class MOD(a: RegNo, b: RegNo, c: RegNo) extends Instr with Product with Serializable

    Divide the values in registers b and c, store the (integer) remainder in register a.

  30. case class MODI(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Divide the value in registers b and the value im, store the (integer) remainder in register a.

  31. case class MOV(a: RegNo, b: RegNo, c: RegNo) extends Instr with Product with Serializable

    Shift the value in register c by b and store the result in register a.

  32. case class MOVI(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Shift the value im by b and store the result in register a.

  33. case class MUL(a: RegNo, b: RegNo, c: RegNo) extends Instr with Product with Serializable

    Muliply the values in registers b and c, store the result in register a.

  34. case class MULI(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Multiply the value in register b and the value im, store the result in register a.

  35. case class MVN(a: RegNo, b: RegNo, c: RegNo) extends Instr with Product with Serializable

    Shift the value in register c by b and store the negation of the result in register a.

  36. case class MVNI(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Shift the value im by b and store the negation of the result in register a.

  37. case class OR(a: RegNo, b: RegNo, c: RegNo) extends Instr with Product with Serializable

    Bitwise OR the values in registers b and c, store the (integer) remainder in register a.

  38. case class ORI(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Bitwise OR the value in registers b and the value im, store the (integer) remainder in register a.

  39. case class POP(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Load register a with the word value stored in register b.

  40. case class PSH(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Add im to the contents of register b and store the result in register b.

  41. sealed abstract class Pseudo extends Assembler

    Pseudo instructions.

  42. case class RD(a: RegNo) extends Instr with Product with Serializable

    Read an integer variable from standard input and store the value in register a.

  43. case class RET(c: RegNo) extends Instr with Product with Serializable

    Set the program counter to the value in register c.

  44. type RegNo = Int

    Register numbers (0-31).

    Register numbers (0-31). Program counter is R28.

  45. case class STB(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Store the least-significant byte of the contents of register a to memory at the address given by the contents of register b plus the value im.

  46. case class STW(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Store the contents of register a to memory at the address given by the contents of register b plus the value im.

  47. case class SUB(a: RegNo, b: RegNo, c: RegNo) extends Instr with Product with Serializable

    Subtract the values in registers b and c, store the result in register a.

  48. case class SUBI(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Subtract the value in register b and the value im, store the result in register a.

  49. case class Target(label: Label) extends Pseudo with Product with Serializable

    Branch target label.

  50. case class WRD(c: RegNo) extends Instr with Product with Serializable

    Write a decimal representation of the value in register c to standard output.

  51. case class WRH(c: RegNo) extends Instr with Product with Serializable

    Write a hexadecimal representation of the value in register c to standard output.

  52. case class WRL() extends Instr with Product with Serializable

    Write a newline to standard output.

  53. case class XOR(a: RegNo, b: RegNo, c: RegNo) extends Instr with Product with Serializable

    Bitwise XOR the values in registers b and c, store the (integer) remainder in register a.

  54. case class XORI(a: RegNo, b: RegNo, im: Imm) extends Instr with Product with Serializable

    Bitwise XOR the value in registers b and the value im, store the (integer) remainder in register a.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  17. def prettyprint(emitter: Emitter, code: AssemCode): Unit

    Pretty-print a list of assembly code instructions to an emitter.

  18. def sayReg(reg: RegNo): String

  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped