sub $dest, $src1, $src2

Subtract one register from another, and store the result in a third register.

Format

This is an RR format instrucion.
31 - 26
25 - 21
20 - 16
15 - 11
10 - 0
001100
dest
src1
src2
00000000000

Functional Description

The sub instruction subtracts one operand register src2 from operand register src2, then stores the result in dest.

dest = src1 + !src2 + 1

Side Effects

If overflow occurs, the exception cause register is logically ored with the value 0x1, and the exception PC (EPC) register is set to the program counter of the offending instruction. Control then flows to an operating system exception handler.

Processor Mode

This is a user-level instruction.


Last modified: Sun Feb 25 12:47:21 CST 2001