|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Nested Class Summary | |
static class |
RISC.Helper
|
Field Summary | |
static int |
ADD
Opcode: integer addition. |
static int |
ADDI
Opcode: integer addition with signed immediate. |
static int |
ADDIU
Opcode: integer addition with unsigned immediate. |
static int |
AND
Opcode: logical and. |
static int |
ANDI
Opcode: logical and with signed immediate. |
static int |
ANDIU
Opcode: logical and with unsigned immediate. |
static int |
ASH
Opcode: arithmetic shift. |
static int |
ASHI
Opcode: arithmetic shift with signed immediate. |
static int |
BEQ
Opcode: branch if equal. |
static int |
BGE
Opcode: branch if greater or equal. |
static int |
BGT
Opcode: branch if greater than. |
static int |
BIC
Opcode: logical bic. |
static int |
BICI
Opcode: logical bic with signed immediate. |
static int |
BICIU
Opcode: logical bic with unsigned immediate. |
static int |
BLE
Opcode: branch if equal less or equal. |
static int |
BLT
Opcode: branch if less than. |
static int |
BNE
Opcode: branch if not equal. |
static int |
BREAK
Opcode: stop execution and return to debugger. |
static int |
BSR
Opcode: branch to subroutine. |
static int |
CHK
Opcode: bound check. |
static int |
CHKI
Opcode: bound check with signed immediate. |
static int |
CHKIU
Opcode: bound check with unsigned immediate. |
static int |
CMP
Opcode: integer comparison. |
static int |
CMPI
Opcode: integer comparison with signed immediate. |
static int |
CMPIU
Opcode: integer comparison with unsigned immediate. |
static int |
DIV
Opcode: integer division. |
static int |
DIVI
Opcode: integer division with signed immediate. |
static int |
DIVIU
Opcode: integer division with unsigned immediate. |
static int |
JSR
Opcode: jump to subroutine. |
static int |
LDB
Opcode: load byte from memory. |
static int |
LDW
Opcode: load word from memory. |
static int |
LNK
Register: return address |
static int |
LSH
Opcode: logical shift. |
static int |
LSHI
Opcode: logical shift with signed immediate. |
static java.lang.String[] |
mnemonics
String representation of instructions |
static int |
MOD
Opcode: integer modulo. |
static int |
MODI
Opcode: integer modulo with signed immediate. |
static int |
MODIU
Opcode: integer modulo with unsigned immediate. |
static int |
MUL
Opcode: integer multiplication. |
static int |
MULI
Opcode: integer multiplication with signed immediate. |
static int |
MULIU
Opcode: integer multiplication with unsigned immediate. |
static int |
OR
Opcode: logical or. |
static int |
ORI
Opcode: logical or with signed immediate. |
static int |
ORIU
Opcode: logical or with unsigned immediate. |
static int |
POP
Opcode: pop word from stack. |
static int |
PSH
Opcode: push word on stack. |
static int |
RES
Register: return value |
static int |
RET
Opcode: jump to return address. |
static int |
SP
Register: stack pointer |
static int |
STB
Opcode: store byte into memory. |
static int |
STW
Opcode: store word into memory. |
static int |
SUB
Opcode: integer subtraction. |
static int |
SUBI
Opcode: integer subtraction with signed immediate. |
static int |
SUBIU
Opcode: integer subtraction with unsigned immediate. |
static int |
SYS_EXIT
System call: terminate the emulation. |
static int |
SYS_GC_ALLOC
System call: allocate a memory block from the heap. |
static int |
SYS_GC_INIT
System call: initialize the garbage collector. |
static int |
SYS_GET_TOTAL_MEM_SIZE
System call: get memory size. |
static int |
SYS_IO_RD_CHR
System call: read one character. |
static int |
SYS_IO_RD_INT
System call: read an integer. |
static int |
SYS_IO_WR_CHR
System call: write one character. |
static int |
SYS_IO_WR_INT
System call: write an integer. |
static int |
SYSCALL
Opcode: invoke a system function. |
static int |
WORD_SIZE
The word size |
static int |
XOR
Opcode: logical xor. |
static int |
XORI
Opcode: logical xor with signed immediate. |
static int |
XORIU
Opcode: logical xor with unsigned immediate. |
static int |
ZERO
Register: zero |
Field Detail |
public static final int WORD_SIZE
public static final int ADD
Opcode: integer addition.
ADD a b c
R.a = R.b + R.c
public static final int SUB
Opcode: integer subtraction.
SUB a b c
R.a = R.b - R.c
public static final int MUL
Opcode: integer multiplication.
MUL a b c
R.a = R.b * R.c
public static final int DIV
Opcode: integer division.
DIV a b c
R.a = R.b / R.c
public static final int MOD
Opcode: integer modulo.
MOD a b c
R.a = R.b % R.c
public static final int CMP
Opcode: integer comparison.
CMP a b c
R.a = <a value with the same sign as (R.b - R.c)
but with a possibly different magnitude>
public static final int OR
Opcode: logical or.
OR a b c
R.a = R.b | R.c
public static final int AND
Opcode: logical and.
AND a b c
R.a = R.b & R.c
public static final int BIC
Opcode: logical bic.
BIC a b c
R.a = R.b & ~R.c
public static final int XOR
Opcode: logical xor.
XOR a b c
R.a = R.b ^ R.c
public static final int LSH
Opcode: logical shift.
LSH a b c
R.a = (R.c > 0) ?
(R.b << R.c) : (R.b >>> -R.c)
public static final int ASH
Opcode: arithmetic shift.
ASH a b c
R.a = (R.c > 0) ?
(R.b << R.c) : (R.b >> -R.c)
public static final int CHK
Opcode: bound check.
CHK a c
(0 <= R.a < R.c)
public static final int ADDI
Opcode: integer addition with signed immediate.
ADDI a b ic
R.a = R.b + ic
public static final int SUBI
Opcode: integer subtraction with signed immediate.
SUBI a b ic
R.a = R.b - ic
public static final int MULI
Opcode: integer multiplication with signed immediate.
MULI a b ic
R.a = R.b * ic
public static final int DIVI
Opcode: integer division with signed immediate.
DIVI a b ic
R.a = R.b / ic
public static final int MODI
Opcode: integer modulo with signed immediate.
MODI a b ic
R.a = R.b % ic
public static final int CMPI
Opcode: integer comparison with signed immediate.
CMPI a b ic
R.a = <a value with the same sign as (R.b - ic)
but with a possibly different magnitude>
public static final int ORI
Opcode: logical or with signed immediate.
ORI a b ic
R.a = R.b | ic
public static final int ANDI
Opcode: logical and with signed immediate.
ANDI a b ic
R.a = R.b & ic
public static final int BICI
Opcode: logical bic with signed immediate.
BICI a b ic
R.a = R.b & ~ic
public static final int XORI
Opcode: logical xor with signed immediate.
XORI a b ic
R.a = R.b ^ ic
public static final int LSHI
Opcode: logical shift with signed immediate.
LSHI a b ic
R.a = (ic > 0) ?
(R.b << ic) : (R.b >>> -ic)
public static final int ASHI
Opcode: arithmetic shift with signed immediate.
ASHI a b ic
R.a = (ic > 0) ?
(R.b << ic) : (R.b >> -ic)
public static final int CHKI
Opcode: bound check with signed immediate.
CHKI a ic
(0 <= R.a < ic)
public static final int ADDIU
Opcode: integer addition with unsigned immediate.
ADDIU a b uc
R.a = R.b + uc
public static final int SUBIU
Opcode: integer subtraction with unsigned immediate.
SUBIU a b uc
R.a = R.b - uc
public static final int MULIU
Opcode: integer multiplication with unsigned immediate.
MULIU a b uc
R.a = R.b * uc
public static final int DIVIU
Opcode: integer division with unsigned immediate.
DIVIU a b uc
R.a = R.b / uc
public static final int MODIU
Opcode: integer modulo with unsigned immediate.
MODIU a b uc
R.a = R.b % uc
public static final int CMPIU
Opcode: integer comparison with unsigned immediate.
CMPIU a b uc
R.a = <a value with the same sign as (R.b - uc)
but with a possibly different magnitude>
public static final int ORIU
Opcode: logical or with unsigned immediate.
ORIU a b uc
R.a = R.b | uc
public static final int ANDIU
Opcode: logical and with unsigned immediate.
ANDIU a b uc
R.a = R.b & uc
public static final int BICIU
Opcode: logical bic with unsigned immediate.
BICIU a b uc
R.a = R.b & ~uc
public static final int XORIU
Opcode: logical xor with unsigned immediate.
XORIU a b uc
R.a = R.b ^ uc
public static final int CHKIU
Opcode: bound check with unsigned immediate.
CHKIU a uc
(0 <= R.a < uc)
public static final int LDW
Opcode: load word from memory. The address R.b
must be aligned on a word boundary.
LDW a b ic
R.a = <word at address R.b + ic>
public static final int LDB
Opcode: load byte from memory.
LDB a b ic
R.a = <byte at address R.b + ic>
public static final int POP
Opcode: pop word from stack. The address R.b
must
be aligned on a word boundary.
POP a b ic
R.a = <word at address R.b>
R.b = R.b + ic
public static final int STW
Opcode: store word into memory. The address R.b
must be aligned on a word boundary.
STW a b ic
<word at address R.b + ic> = R.a
public static final int STB
Opcode: store byte into memory.
STB a b ic
<byte at address R.b + ic> = (byte)R.a
public static final int PSH
Opcode: push word on stack. The address R.b
must
be aligned on a word boundary.
PSH a b ic
R.b = R.b - ic
<word at address R.b> = R.a
public static final int BEQ
Opcode: branch if equal.
BEQ a oc
(PC + 4*oc)
if (R.a == 0)
public static final int BNE
Opcode: branch if not equal.
BNE a oc
(PC + 4*oc)
if (R.a != 0)
public static final int BLT
Opcode: branch if less than.
BLT a oc
(PC + 4*oc)
if (R.a < 0)
public static final int BGE
Opcode: branch if greater or equal.
BGE a oc
(PC + 4*oc)
if (R.a >= 0)
public static final int BLE
Opcode: branch if equal less or equal.
BLE a oc
(PC + 4*oc)
if (R.a <= 0)
public static final int BGT
Opcode: branch if greater than.
BGT a oc
(PC + 4*oc)
if (R.a > 0)
public static final int BSR
Opcode: branch to subroutine.
BSR oc
R.31 = PC + 4
(PC + 4*oc)
public static final int JSR
Opcode: jump to subroutine.
JSR lc
R.31 = PC + 4
(4*lc)
public static final int RET
Opcode: jump to return address.
RET c
R.c
public static final int BREAK
Opcode: stop execution and return to debugger.
BREAK
public static final int SYSCALL
Opcode: invoke a system function.
SYSCALL a b uc
uc
with registers
R.a
and R.b
public static final int SYS_IO_RD_CHR
System call: read one character.
SYSCALL a 0 SYS_IO_RD_CHR
R.a = <Unicode of read character or -1 if EOF>
public static final int SYS_IO_RD_INT
System call: read an integer.
SYSCALL a 0 SYS_IO_RD_INT
R.a = <value of read integer>
public static final int SYS_IO_WR_CHR
System call: write one character.
SYSCALL a 0 SYS_IO_WR_CHR
<write character with Unicode R.a>
public static final int SYS_IO_WR_INT
System call: write an integer.
SYSCALL a b SYS_IO_WR_INT
<write signed value R.a in decimal format and
space padded to width R.b>
public static final int SYS_GC_INIT
System call: initialize the garbage collector.
The garbage collector is initialized with an empty heap that
starts at address R.a and with a maximum size of
sz = R.b & 0x07FFFFFF
words. If sz
is
zero then the heap extends to the end of the memory.
The value sp = R.b >>> 27
determines
whether there is a stack and which register is the stack
pointer: if sp
is non-zero, the garbage collector
assumes that there is a stack and that R.sp
is the
stack pointer register. It is assumed that the stack starts at
the end of the memory and grows downwards.
During a garbage collection, the garbage collector frees all the memory blocks which are not referenced by any live pointer. A live pointer (resp. value) is either a root pointer (resp. value) or a pointer (resp. value) contained in a block referenced by a live pointer. Note that as there is no way to distinguish between pointers and non-pointer values, all values are regarded as pointers. A root value is one that is contained in a register, in the memory below the heap or in the stack. If there is no stack, all the values contained in the memory above the heap are also root values.
SYSCALL a b SYS_GC_INIT
<initialize the garbage collector>
public static final int SYS_GC_ALLOC
System call: allocate a memory block from the heap.
Allocates a memory block of, at least, R.b
bytes from the heap and returns its address in
R.a
. The allocated memory is zero-initialized and
its address is guaranteed to be aligned on a word boundary. If
there is not enough free memory, a garbage collection is
triggered and if this doesn't free enough memory, an error is
raised and the execution stopped.
SYSCALL a b SYS_GC_ALLOC
R.a = <address of the newly allocated and
zero-initialized memory block of R.b bytes>
public static final int SYS_GET_TOTAL_MEM_SIZE
System call: get memory size.
SYSCALL a 0 SYS_GET_TOTAL_MEM_SIZE
R.a = <memory size in bytes>
public static final int SYS_EXIT
System call: terminate the emulation.
SYSCALL a 0 SYS_EXIT
<terminates the emulation with status code R.a>
public static final int ZERO
public static final int RES
public static final int SP
public static final int LNK
public static final java.lang.String[] mnemonics
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |