Test

The Test microinstruction allows jumping to other microinstructions within the current fetch or execute sequence. The test microinstruction compares the value in a part of a register with a specific value. If the comparison succeeds, then a specified number of successive microinstructions in the current fetch or execute sequence are skipped over.

Parameters:

Register: the register containing the range of bits to be tested.

Start: an integer indicating the index of the first bit in the range of bits to be tested in the register. The value must be an integer between 0 and one less than the width of the register. Bit 0 is the left-most bit of the register if indexing is done from the left and is the right-most bit if indexing is done from the right. Use the Options Dialog to specify the indexing direction.

Number of bits: a non-negative integer indicating the number of bits in the range to be tested. The sum of the start index and the number of bits must be at most the width of the register.

Comparison: the type of comparison be done:

LT means "less than"
LE means "less than or equal to"
EQ means "equal to"
NE means "not equal to"
GE means "greater than or equal to"
GT means "greater than"

Comparison value: the integer to be compared with the range of bits of the register.

Omission: an integer (positive, negative or zero) indicating the size of the relative jump. For example, if omission = 0, then no jump is performed. That is, the microinstruction following the test microinstruction is the next microinstruction to be executed, as normally happens with other microinstructions. If omission = 1, then the microinstruction immediately following the test microinstruction is skipped over if the comparison succeeds. If omission = -1 and the comparison succeeds, then the test microinstruction is repeatedly executed in an infinite loop.

N.B. When you test a register or part of a register against a value, you can consider the part of the register to designate a two's-complement integer value or an unsigned integer value. For example, if you are testing to see whether two bits are "11", you can either test whether the value stored in the two bits is -1 or test whether the value is 3. Similarly, to test whether one bit of a register is a "1", you can test to see whether that part of the register contains the value 1 or -1.