MoveCode Type
This type defines move code instructions with methods for encoding, decoding, string conversion, and parsing from strings and byte arrays. For the encoding into machine words (byte arrays), see the addresses of PUs and buffers in the SCAD reference sheet. Hence, the general purpose PUs have indices \(2,\ldots,\mathsf{numPU}+1\), and their input and output buffers have addresses \(4,\ldots,2\cdot\mathsf{numPU}+3\). If these numbers are encoded as radix-2 numbers, we need \(\left\lceil{\log_2(2\cdot\mathsf{numPU}+4)}\right\rceil\) bits for the source address and the same number of bits for the target address. Together with the two bits to determine one of the four kinds of move instructions, we finally obtain instructions |mv|srcAdr|tgtAdr| where mv has two bits, and each one of srcAdr and tgtAdr has \(\left\lceil{\log_2(2\cdot\mathsf{numPU}+4)}\right\rceil\) bits. Hence, we get
- \(\mathsf{numBits(numPU)} := 2+2\cdot \left\lceil{\log_2(2\cdot\mathsf{numPU}+4)}\right\rceil\)
- \(\mathsf{maxPU(numBits)} := 2^{\frac{\mathsf{numBits}}{2}-2}-2\)
Instance members
Instance member | Description |
Full Usage:
this.Encode
Returns: byte array
|
encode move instruction as byte array
|
Full Usage:
this.InstrCode
Returns: int
|
determine opcode for machine instruction encoding, i.e., 0 for buffer move, 1 for constant move, 2 for opcode move, and 3 for jump/branches
|
Full Usage:
this.Listing
Returns: string
|
list move instruction in listings with byte and bitvector representation as well as the readable form in a comment, e.g. Dup -> PU[0].opc // 2A-0A : 0010101-0000010-10
|
Full Usage:
this.isBufMove ()
Returns: bool
|
|
Full Usage:
this.isCstMove ()
Returns: bool
|
|
Full Usage:
this.isJmpMove ()
Returns: bool
|
|
Full Usage:
this.isOpcLSU ()
Returns: bool
|
|
Full Usage:
this.isOpcMove ()
Returns: bool
|
|
Full Usage:
this.isValid ()
Returns: bool
|
check whether the move code combination is a valid one
|
Static members
Static member | Description |
|
|
Full Usage:
MoveCode.OfString(srcStr, tgtStr)
Parameters:
string
tgtStr : string
Returns: MoveCode
|