URL
https://opencores.org/ocsvn/yacc/yacc/trunk
Subversion Repositories yacc
[/] [yacc/] [trunk/] [doc/] [instruction.htm] - Rev 4
Compare with Previous | Blame | View Log
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 9.0.2.0 for Windows"> <META http-equiv="Content-Style-Type" content="text/css"> <TITLE></TITLE> </HEAD> <BODY> <P><B>2.3 Supported Instructions</B><BR> <BR> Not supported item is displayed as <FONT color="#ff0000">red characters</FONT>.<BR> Unaligned load and store operations (LWL,SWL,LWR,SWR) are not supported.<BR> </P> <H3>ADD -- <I>Add</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Adds two registers and stores the result in a register<FONT color="#ff0000">(Exception by Overflow)</FONT> <TR> <TD>Operation: <TD>$d = $s + $t; <TR> <TD>Syntax: <TD>add $d, $s, $t <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD width="62" height="35">Destination</TD> <TD width="134" height="35">Shift</TD> <TD height="35">Function</TD> </TR> <TR> <TD width="93" height="30">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5bit</TD> <TD width="62" height="30">5bit</TD> <TD width="134" height="30">5bit</TD> <TD height="30">6'b100_000</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>ADDI -- <I>Add immediate</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Adds a register and a signed immediate value and stores the result in a register <TR> <TD>Operation: <TD>$t = $s + imm; <TR> <TD>Syntax: <TD>addi $t, $s, imm <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b001000</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5bit</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>ADDIU -- <I>Add immediate unsigned</I></H3> <TABLE border="1" width="595" height="152"> <TBODY> <TR> <TD>Description: <TD>Adds a register and an unsigned immediate value and stores the result in a register <TR> <TD>Operation: <TD>$t = $s + imm; <TR> <TD>Syntax: <TD>addiu $t, $s, imm <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b001001</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5bit</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>ADDU -- <I>Add unsigned</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Adds two registers and stores the result in a register <TR> <TD>Operation: <TD>$d = $s + $t; <TR> <TD>Syntax: <TD>addu $d, $s, $t <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD width="62" height="35">Destination</TD> <TD width="134" height="35">Shift</TD> <TD height="35">Function</TD> </TR> <TR> <TD width="93" height="30">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5bit</TD> <TD width="62" height="30">5bit</TD> <TD width="134" height="30">5'h0</TD> <TD height="30">6'b100_001</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>AND -- <I>Bitwise and</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Bitwise ands two registers and stores the result in a register <TR> <TD>Operation: <TD>$d = $s & $t; <TR> <TD>Syntax: <TD>and $d, $s, $t <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="98" height="42">OPCODE</TD> <TD width="32" height="42">Source</TD> <TD width="82" height="42">Target</TD> <TD width="62" height="42">Destination</TD> <TD width="134" height="42">Shift</TD> <TD height="42">Function</TD> </TR> <TR> <TD width="98" height="25">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="25">5bit</TD> <TD width="82" height="25">5bit</TD> <TD width="62" height="25">5bit</TD> <TD width="134" height="25">5'h0</TD> <TD height="25">6'b100100</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>ANDI -- <I>Bitwise and immediate</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Bitwise ands a register and an immediate value and stores the result in a register <TR> <TD>Operation: <TD>$t = $s & imm; <TR> <TD>Syntax: <TD>andi $t, $s, imm <TR> <TD>Encoding: <TD> <TABLE border="1" width="519"> <TBODY> <TR> <TD width="93" height="37">OPCODE</TD> <TD width="25" height="37">Source</TD> <TD width="82" height="37">Target</TD> <TD colspan="4" width="286" height="37">Immediate</TD> </TR> <TR> <TD width="93" height="28"><CODE>6'b001100</CODE></TD> <TD width="25" height="28">5bit</TD> <TD width="82" height="28">5bit</TD> <TD colspan="4" width="286" height="28">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>BEQ -- <I>Branch on equal</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Branches if the two registers are equal <TR> <TD>Operation: <TD>if $s == $t PC +=imm << 2; <TR> <TD>Syntax: <TD>beq $s, $t, imm <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b000100</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5'h0</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>BGEZ -- <I>Branch on greater than or equal to zero</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Branches if the register is greater than or equal to zero <TR> <TD>Operation: <TD>if $s >= 0 PC +=offset << 2; <TR> <TD>Syntax: <TD>bgez $s, offset <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b000001</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5'b00001</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3><FONT color="#ff0000">BGEZAL -- Branch on greater than or equal to zero and link</FONT></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Branches if the register is greater than or equal to zero and saves the return address in $31 <TR> <TD>Operation: <TD>if $s >= 0 $31 = PC + 8 ; PC +=imm << 2; <TR> <TD>Syntax: <TD>bgezal $s, imm <TR> <TD>Encoding: <TD> <TABLE border="1" width="595"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b000001</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5'h10001</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>BGTZ -- <I>Branch on greater than zero</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Branches if the register is greater than zero <TR> <TD>Operation: <TD>if $s > 0 PC +=imm << 2; <TR> <TD>Syntax: <TD>bgtz $s, imm <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b000111</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5'h0</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>BLEZ -- <I>Branch on less than or equal to zero</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Branches if the register is less than or equal to zero <TR> <TD>Operation: <TD>if $s <= 0 PC +=imm << 2; <TR> <TD>Syntax: <TD>blez $s, imm <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b000110</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5'h0</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>BLTZ -- <I>Branch on less than zero</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Branches if the register is less than zero <TR> <TD>Operation: <TD>if $s < 0 PC+=imm << 2; <TR> <TD>Syntax: <TD>bltz $s, imm <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b00001</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5'b00000</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3><FONT color="#ff0000">BLTZAL -- Branch on less than zero and link</FONT></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Branches if the register is less than zero and saves the return address in $31 <TR> <TD>Operation: <TD>if $s < 0 $31 = PC + 8 ; PC+=imm << 2; <TR> <TD>Syntax: <TD>bltzal $s, imm <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b000001</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5'b10000</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>BNE -- <I>Branch on not equal</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Branches if the two registers are not equal <TR> <TD>Operation: <TD>if $s != $t PC+=imm << 2; <TR> <TD>Syntax: <TD>bne $s, $t, imm <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b000101</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5'h0</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3><FONT color="#ff0000">Break -- Break</FONT> </H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Generates break point. <TR> <TD>Operation: <TD> <TR> <TD>Syntax: <TD>break <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="98" height="42">OPCODE</TD> <TD width="32" height="42">Source</TD> <TD width="82" height="42">Target</TD> <TD width="62" height="42">Destination</TD> <TD width="134" height="42">Shift</TD> <TD height="42">Function</TD> </TR> <TR> <TD width="98" height="25">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="25">?????</TD> <TD width="82" height="25">?????</TD> <TD width="62" height="25">?????</TD> <TD width="134" height="25">?????</TD> <TD height="25">6'b001101</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <P><BR> <BR> </P> <H3>DIV -- <I>Divide</I></H3> <TABLE border="1" width="597" height="167"> <TBODY> <TR> <TD>Description: <TD>Divides $s by $t and stores the quotient in $LO and the remainder in $HI <TR> <TD>Operation: <TD>$LO = $s / $t; $HI = $s % $t; <TR> <TD>Syntax: <TD>div $s, $t <TR> <TD>Encoding: <TD> <TABLE border="1" width="515"> <TBODY> <TR> <TD width="99" height="25">OPCODE</TD> <TD width="30" height="25">Source</TD> <TD width="82" height="25">Target</TD> <TD width="62" height="25">Destination</TD> <TD width="134" height="25">Shift</TD> <TD width="115" height="25">Function</TD> </TR> <TR> <TD width="99" height="42">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="30" height="42">5bit</TD> <TD width="82" height="42">5bit</TD> <TD width="62" height="42">5'h0</TD> <TD width="134" height="42">5'h0</TD> <TD width="115" height="42">6'b011010</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>DIVU -- <I>Divide unsigned</I></H3> <TABLE border="1" width="615"> <TBODY> <TR> <TD>Description: <TD>Divides $s by $t and stores the quotient in $LO and the remainder in $HI <TR> <TD>Operation: <TD>$LO = $s / $t; $HI = $s % $t; <TR> <TD>Syntax: <TD>divu $s, $t <TR> <TD>Encoding: <TD> <TABLE border="1" width="524"> <TBODY> <TR> <TD width="100" height="39">OPCODE</TD> <TD width="31" height="39">Source</TD> <TD width="52" height="39">Target</TD> <TD width="62" height="39">Destination</TD> <TD width="134" height="39">Shift</TD> <TD width="94" height="39">Function</TD> </TR> <TR> <TD width="100" height="32">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="31" height="32">5bit</TD> <TD width="52" height="32">5bit</TD> <TD width="62" height="32">5'h0</TD> <TD width="134" height="32">5'h0</TD> <TD width="94" height="32">6'b011011</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>J -- <I>Jump</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Jumps to the calculated address <TR> <TD>Operation: <TD>PC = nPC; nPC = (PC & 0xf0000000) | (imm26 << 2); <TR> <TD>Syntax: <TD>j imm26 <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD height="35" colspan="5">Immediate</TD> </TR> <TR> <TD width="93" height="30">6'b000010</TD> <TD height="30" width="31" colspan="5">26bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>JAL -- <I>Jump and link</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Jumps to the calculated address and stores the return address in $31 <TR> <TD>Operation: <TD>$31 = PC + 8 ; PC = nPC; nPC = (PC & 0xf0000000) | (imm26 << 2); <TR> <TD>Syntax: <TD>jal imm26 <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD height="35" colspan="5">Immediate</TD> </TR> <TR> <TD width="93" height="30">6'b000011</TD> <TD height="30" width="31" colspan="5">26bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>JALR -- <I>Jump and link Register</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Jump to the address contained in register $s and stores the return address in $d <TR> <TD>Operation: <TD>$d = PC + 8 ; PC = $s <TR> <TD>Syntax: <TD>jalr $d,$s <TR> <TD>Encoding: <TD> <TABLE border="1" width="524"> <TBODY> <TR> <TD width="100" height="39">OPCODE</TD> <TD width="31" height="39">Source</TD> <TD width="52" height="39">Target</TD> <TD width="62" height="39">Destination</TD> <TD width="134" height="39">Shift</TD> <TD width="94" height="39">Function</TD> </TR> <TR> <TD width="100" height="32">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="31" height="32">5bit</TD> <TD width="52" height="32">5'h0</TD> <TD width="62" height="32">5bit</TD> <TD width="134" height="32">5'h0</TD> <TD width="94" height="32">6'b001001</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>JR -- <I>Jump register</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Jump to the address contained in register $s <TR> <TD>Operation: <TD>PC = nPC; nPC = $s; <TR> <TD>Syntax: <TD>jr $s <TR> <TD>Encoding: <TD> <TABLE border="1" width="524"> <TBODY> <TR> <TD width="100" height="39">OPCODE</TD> <TD width="31" height="39">Source</TD> <TD width="52" height="39">Target</TD> <TD width="62" height="39">Destination</TD> <TD width="134" height="39">Shift</TD> <TD width="94" height="39">Function</TD> </TR> <TR> <TD width="100" height="32">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="31" height="32">5bit</TD> <TD width="52" height="32">5'h0</TD> <TD width="62" height="32">5'h0</TD> <TD width="134" height="32">5'h0</TD> <TD width="94" height="32">6'b001000</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>LB -- <I>Load byte</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>A signed extented byte is loaded into a register from the specified address. <TR> <TD>Operation: <TD>$t = MEM[$s + imm]; ; <TR> <TD>Syntax: <TD>lb $t, imm($s) <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b100000</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5bit</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>LBU -- <I>Load byte unsigned</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>A unsigned extented byte is loaded into a register from the specified address. <TR> <TD>Operation: <TD>$t = MEM[$s + imm]; ; <TR> <TD>Syntax: <TD>lbu $t, imm($s) <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b100100</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5bit</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <P><BR> </P> <H3>LH -- <I>Load Half</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>A signed extented half word is loaded into a register from the specified address. <TR> <TD>Operation: <TD>$t = MEM[$s + imm]; ; <TR> <TD>Syntax: <TD>lh $t, imm($s) <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b100001</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5bit</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <P><BR> </P> <H3>LHU -- <I>Load Half unsigned</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>A byte is loaded into a register from the specified address. <TR> <TD>Operation: <TD>$t = MEM[$s + imm]; ; <TR> <TD>Syntax: <TD>lhu $t, imm($s) <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b100101</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5bit</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <P><BR> </P> <H3>LUI -- <I>Load upper immediate</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>The immediate value is shifted left 16 bits and stored in the register. The lower 16 bits are zeroes. <TR> <TD>Operation: <TD>$t = (imm << 16); <TR> <TD>Syntax: <TD>lui $t, imm <TR> <TD>Encoding: <TD> <TABLE border="1" width="634"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b001111</CODE></TD> <TD width="25" height="30">?????</TD> <TD width="82" height="30">5bit</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>LW -- <I>Load word</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>A word is loaded into a register from the specified address. <TR> <TD>Operation: <TD>$t = MEM[$s + imm]; <TR> <TD>Syntax: <TD>lw $t, imm($s) <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b100011</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5bit</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>MFHI -- <I>Move from HI</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>The contents of register HI are moved to the specified register. <TR> <TD>Operation: <TD>$d = $HI; <TR> <TD>Syntax: <TD>mfhi $d <TR> <TD>Encoding: <TD> <TABLE border="1" width="524"> <TBODY> <TR> <TD width="100" height="39">OPCODE</TD> <TD width="31" height="39">Source</TD> <TD width="52" height="39">Target</TD> <TD width="62" height="39">Destination</TD> <TD width="134" height="39">Shift</TD> <TD width="94" height="39">Function</TD> </TR> <TR> <TD width="100" height="32">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="31" height="32">5'h0</TD> <TD width="52" height="32">5'h0</TD> <TD width="62" height="32">5bit</TD> <TD width="134" height="32">5'h0</TD> <TD width="94" height="32">6'b010000</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>MFLO -- <I>Move from LO</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>The contents of register LO are moved to the specified register. <TR> <TD>Operation: <TD>$d = $LO; <TR> <TD>Syntax: <TD>mflo $d <TR> <TD>Encoding: <TD> <TABLE border="1" width="524"> <TBODY> <TR> <TD width="100" height="39">OPCODE</TD> <TD width="31" height="39">Source</TD> <TD width="52" height="39">Target</TD> <TD width="62" height="39">Destination</TD> <TD width="134" height="39">Shift</TD> <TD width="94" height="39">Function</TD> </TR> <TR> <TD width="100" height="32">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="31" height="32">5'h0</TD> <TD width="52" height="32">5'h0</TD> <TD width="62" height="32">5bit</TD> <TD width="134" height="32">5'h0</TD> <TD width="94" height="32">6'b010010</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3><FONT color="#ff0000">MTHI -- Move to HI</FONT></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>The contents of register $s are moved to $HI. <TR> <TD>Operation: <TD> $HI=$s; <TR> <TD>Syntax: <TD>mthi $s <TR> <TD>Encoding: <TD> <TABLE border="1" width="524"> <TBODY> <TR> <TD width="100" height="39">OPCODE</TD> <TD width="31" height="39">Source</TD> <TD width="52" height="39">Target</TD> <TD width="62" height="39">Destination</TD> <TD width="134" height="39">Shift</TD> <TD width="94" height="39">Function</TD> </TR> <TR> <TD width="100" height="32">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="31" height="32">5'bit</TD> <TD width="52" height="32">5'h0</TD> <TD width="62" height="32">5'h0</TD> <TD width="134" height="32">5'h0</TD> <TD width="94" height="32">6'b010001</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3><FONT color="#ff0000">MTLO -- Move to LO</FONT></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>The contents of register $s are moved to $HI. <TR> <TD>Operation: <TD>$LO=$s; <TR> <TD>Syntax: <TD>mtlo $s <TR> <TD>Encoding: <TD> <TABLE border="1" width="524"> <TBODY> <TR> <TD width="100" height="39">OPCODE</TD> <TD width="31" height="39">Source</TD> <TD width="52" height="39">Target</TD> <TD width="62" height="39">Destination</TD> <TD width="134" height="39">Shift</TD> <TD width="94" height="39">Function</TD> </TR> <TR> <TD width="100" height="32">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="31" height="32">5'bit</TD> <TD width="52" height="32">5'h0</TD> <TD width="62" height="32">5'h0</TD> <TD width="134" height="32">5'h0</TD> <TD width="94" height="32">6'b010011</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <P><BR> </P> <H3>MULT -- <I>Multiply</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Multiplies $s by $t and stores the result in $LO. <TR> <TD>Operation: <TD>$LO = $s * $t; <TR> <TD>Syntax: <TD>mult $s, $t <TR> <TD>Encoding: <TD> <TABLE border="1" width="515"> <TBODY> <TR> <TD width="99" height="25">OPCODE</TD> <TD width="30" height="25">Source</TD> <TD width="82" height="25">Target</TD> <TD width="62" height="25">Destination</TD> <TD width="134" height="25">Shift</TD> <TD width="115" height="25">Function</TD> </TR> <TR> <TD width="99" height="42">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="30" height="42">5bit</TD> <TD width="82" height="42">5bit</TD> <TD width="62" height="42">5'h0</TD> <TD width="134" height="42">5'h0</TD> <TD width="115" height="42">6'b011000</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>MULTU -- <I>Multiply unsigned</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Multiplies $s by $t and stores the result in $LO. <TR> <TD>Operation: <TD>$LO = $s * $t; <TR> <TD>Syntax: <TD>multu $s, $t <TR> <TD>Encoding: <TD> <TABLE border="1" width="515"> <TBODY> <TR> <TD width="99" height="25">OPCODE</TD> <TD width="30" height="25">Source</TD> <TD width="82" height="25">Target</TD> <TD width="62" height="25">Destination</TD> <TD width="134" height="25">Shift</TD> <TD width="115" height="25">Function</TD> </TR> <TR> <TD width="99" height="42">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="30" height="42">5bit</TD> <TD width="82" height="42">5bit</TD> <TD width="62" height="42">5'h0</TD> <TD width="134" height="42">5'h0</TD> <TD width="115" height="42">6'b011001</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>NOR -- <I>Bitwise nor</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Bitwise logical nors two registers and stores the result in a register <TR> <TD>Operation: <TD>$d = ~($s | $t); <TR> <TD>Syntax: <TD>nor $d, $s, $t <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="98" height="42">OPCODE</TD> <TD width="32" height="42">Source</TD> <TD width="82" height="42">Target</TD> <TD width="62" height="42">Destination</TD> <TD width="134" height="42">Shift</TD> <TD height="42">Function</TD> </TR> <TR> <TD width="98" height="25">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="25">5bit</TD> <TD width="82" height="25">5bit</TD> <TD width="62" height="25">5bit</TD> <TD width="134" height="25">5'h0</TD> <TD height="25">6'b100111</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <P> <BR> </P> <H3>OR -- <I>Bitwise or</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Bitwise logical ors two registers and stores the result in a register <TR> <TD>Operation: <TD>$d = $s | $t; <TR> <TD>Syntax: <TD>or $d, $s, $t <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="98" height="42">OPCODE</TD> <TD width="32" height="42">Source</TD> <TD width="82" height="42">Target</TD> <TD width="62" height="42">Destination</TD> <TD width="134" height="42">Shift</TD> <TD height="42">Function</TD> </TR> <TR> <TD width="98" height="25">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="25">5bit</TD> <TD width="82" height="25">5bit</TD> <TD width="62" height="25">5bit</TD> <TD width="134" height="25">5'h0</TD> <TD height="25">6'b100101</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>ORI -- <I>Bitwise or immediate</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Bitwise ors a register and an immediate value and stores the result in a register <TR> <TD>Operation: <TD>$t = $s | imm; <TR> <TD>Syntax: <TD>ori $t, $s, imm <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="34">OPCODE</TD> <TD width="25" height="34">Source</TD> <TD width="82" height="34">Target</TD> <TD colspan="4" width="261" height="34">Immediate</TD> </TR> <TR> <TD width="93" height="31"><CODE>6'b001101</CODE></TD> <TD width="25" height="31">5bit</TD> <TD width="82" height="31">5bit</TD> <TD colspan="4" width="261" height="31">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>SB -- <I>Store byte</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>The least significant byte of $t is stored at the specified address. <TR> <TD>Operation: <TD>MEM[$s + imm] = (0xff & $t); <TR> <TD>Syntax: <TD>sb $t, imm($s) <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b101000</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5bit</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>SH -- <I>Store Half</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>The least significant half word of $t is stored at the specified address. <TR> <TD>Operation: <TD>MEM[$s + imm] = (0xffff & $t); <TR> <TD>Syntax: <TD>sh $t, imm($s) <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b101001</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5bit</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <P><BR> </P> <H3>SLL -- <I>Shift left logical </I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Shifts a register value left by the shift amount listed in the instruction and places the result in a third register. Zeroes are shifted in. <TR> <TD>Operation: <TD>$d = $t << h; <TR> <TD>Syntax: <TD>sll $d, $t, h <TR> <TD>Encoding: <TD> <TABLE border="1" width="779"> <TBODY> <TR> <TD width="98" height="38">OPCODE</TD> <TD width="32" height="38">Source</TD> <TD width="82" height="38">Target</TD> <TD width="62" height="38">Destination</TD> <TD width="134" height="38">Shift</TD> <TD width="388" height="38">Function</TD> </TR> <TR> <TD width="98" height="36">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="36">5bit</TD> <TD width="82" height="36">5bit</TD> <TD width="62" height="36">5bit</TD> <TD width="134" height="36">h</TD> <TD width="388" height="36">6'b000000</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>SLLV -- <I>Shift left logical variable</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Shifts a register value left by the value in a second register and places the result in a third register. Zeroes are shifted in. <TR> <TD>Operation: <TD>$d = $t << $s; <TR> <TD>Syntax: <TD>sllv $d, $t, $s <TR> <TD>Encoding: <TD> <TABLE border="1" width="775"> <TBODY> <TR> <TD width="98" height="37">OPCODE</TD> <TD width="32" height="37">Source</TD> <TD width="82" height="37">Target</TD> <TD width="62" height="37">Destination</TD> <TD width="134" height="37">Shift</TD> <TD width="415" height="37">Function</TD> </TR> <TR> <TD width="98" height="37">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="37">5bit</TD> <TD width="82" height="37">5bit</TD> <TD width="62" height="37">5bit</TD> <TD width="134" height="37">?????</TD> <TD width="415" height="37">6'b000100</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>SLT -- <I>Set on less than (signed)</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>If $s is less than $t, $d is set to one. It gets zero otherwise. <TR> <TD>Operation: <TD>if $s < $t $d = 1; else $d = 0; <TR> <TD>Syntax: <TD>slt $d, $s, $t <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="98" height="42">OPCODE</TD> <TD width="32" height="42">Source</TD> <TD width="82" height="42">Target</TD> <TD width="62" height="42">Destination</TD> <TD width="134" height="42">Shift</TD> <TD height="42">Function</TD> </TR> <TR> <TD width="98" height="25">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="25">5bit</TD> <TD width="82" height="25">5bit</TD> <TD width="62" height="25">5bit</TD> <TD width="134" height="25">5'h0</TD> <TD height="25">6'b101010</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>SLTI -- <I>Set on less than immediate (signed)</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>If $s is less than immediate, $t is set to one. It gets zero otherwise. <TR> <TD>Operation: <TD>if $s < imm $t = 1; else $t = 0; <TR> <TD>Syntax: <TD>slti $t, $s, imm <TR> <TD>Encoding: <TD> <TABLE border="1" width="530"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b001010</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5bit</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>SLTIU -- <I>Set on less than immediate unsigned</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>If $s is less than the unsigned immediate, $t is set to one. It gets zero otherwise. <TR> <TD>Operation: <TD>if $s < imm $t = 1; else $t = 0; <TR> <TD>Syntax: <TD>sltiu $t, $s, imm <TR> <TD>Encoding: <TD> <TABLE border="1" width="530"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b001011</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5bit</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>SLTU -- <I>Set on less than unsigned</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>If $s is less than $t, $d is set to one. It gets zero otherwise. <TR> <TD>Operation: <TD>if $s < $t $d = 1; else $d = 0; <TR> <TD>Syntax: <TD>sltu $d, $s, $t <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="98" height="42">OPCODE</TD> <TD width="32" height="42">Source</TD> <TD width="82" height="42">Target</TD> <TD width="62" height="42">Destination</TD> <TD width="134" height="42">Shift</TD> <TD height="42">Function</TD> </TR> <TR> <TD width="98" height="25">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="25">5bit</TD> <TD width="82" height="25">5bit</TD> <TD width="62" height="25">5bit</TD> <TD width="134" height="25">5'h0</TD> <TD height="25">6'b101011</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>SRA -- <I>Shift right arithmetic</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Shifts a register value right by the shift amount (shamt) and places the value in the destination register. The sign bit is shifted in. <TR> <TD>Operation: <TD>$d = $t >> h; <TR> <TD>Syntax: <TD>sra $d, $t, h <TR> <TD>Encoding: <TD> <TABLE border="1" width="775"> <TBODY> <TR> <TD width="98" height="42">OPCODE</TD> <TD width="32" height="42">Source</TD> <TD width="82" height="42">Target</TD> <TD width="62" height="42">Destination</TD> <TD width="134" height="42">Shift</TD> <TD width="415" height="42">Function</TD> </TR> <TR> <TD width="98" height="32">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="32">5bit</TD> <TD width="82" height="32">5bit</TD> <TD width="62" height="32">5bit</TD> <TD width="134" height="32">h</TD> <TD width="415" height="32">6'b000011</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <P><BR> </P> <H3>SRAV -- <I>Shift right arithmatic variable</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Shifts a register value right by the value in a second register and places the result in a third register. the sign bit is shifterd in. <TR> <TD>Operation: <TD>$d = $t >> $s; <TR> <TD>Syntax: <TD>srav $d, $t, $s <TR> <TD>Encoding: <TD> <TABLE border="1" width="775"> <TBODY> <TR> <TD width="98" height="37">OPCODE</TD> <TD width="32" height="37">Source</TD> <TD width="82" height="37">Target</TD> <TD width="62" height="37">Destination</TD> <TD width="134" height="37">Shift</TD> <TD width="415" height="37">Function</TD> </TR> <TR> <TD width="98" height="37">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="37">5bit</TD> <TD width="82" height="37">5bit</TD> <TD width="62" height="37">5bit</TD> <TD width="134" height="37">?????</TD> <TD width="415" height="37">6'b000111</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <P><BR> </P> <H3>SRL -- <I>Shift right logical</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Shifts a register value right by the shift amount (shamt) and places the value in the destination register. Zeroes are shifted in. <TR> <TD>Operation: <TD>$d = $t >> h; <TR> <TD>Syntax: <TD>srl $d, $t, h <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="98" height="42">OPCODE</TD> <TD width="32" height="42">Source</TD> <TD width="82" height="42">Target</TD> <TD width="62" height="42">Destination</TD> <TD width="134" height="42">Shift</TD> <TD height="42">Function</TD> </TR> <TR> <TD width="98" height="25">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="25">5bit</TD> <TD width="82" height="25">5bit</TD> <TD width="62" height="25">5bit</TD> <TD width="134" height="25">h</TD> <TD height="25">6'b000010</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>SRLV -- <I>Shift right logical variable</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Shifts a register value right by the amount specified in $s and places the value in the destination register. Zeroes are shifted in. <TR> <TD>Operation: <TD>$d = $t >> $s; <TR> <TD>Syntax: <TD>srlv $d, $t, $s <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="98" height="42">OPCODE</TD> <TD width="32" height="42">Source</TD> <TD width="82" height="42">Target</TD> <TD width="62" height="42">Destination</TD> <TD width="134" height="42">Shift</TD> <TD height="42">Function</TD> </TR> <TR> <TD width="98" height="25">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="25">5bit</TD> <TD width="82" height="25">5bit</TD> <TD width="62" height="25">5bit</TD> <TD width="134" height="25">5'h0</TD> <TD height="25">6'b000110</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>SUB -- <I>Subtract</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Subtracts two registers and stores the result in a register<FONT color="#ff0000">(Exception by Overflow)</FONT> <TR> <TD>Operation: <TD>$d = $s - $t; <TR> <TD>Syntax: <TD>sub $d, $s, $t <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="98" height="42">OPCODE</TD> <TD width="32" height="42">Source</TD> <TD width="82" height="42">Target</TD> <TD width="62" height="42">Destination</TD> <TD width="134" height="42">Shift</TD> <TD height="42">Function</TD> </TR> <TR> <TD width="98" height="25">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="25">5bit</TD> <TD width="82" height="25">5bit</TD> <TD width="62" height="25">5bit</TD> <TD width="134" height="25">5'h0</TD> <TD height="25">6'b100010</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>SUBU -- <I>Subtract unsigned</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Subtracts two registers and stores the result in a register <TR> <TD>Operation: <TD>$d = $s - $t; <TR> <TD>Syntax: <TD>subu $d, $s, $t <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="98" height="42">OPCODE</TD> <TD width="32" height="42">Source</TD> <TD width="82" height="42">Target</TD> <TD width="62" height="42">Destination</TD> <TD width="134" height="42">Shift</TD> <TD height="42">Function</TD> </TR> <TR> <TD width="98" height="25">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="25">5bit</TD> <TD width="82" height="25">5bit</TD> <TD width="62" height="25">5bit</TD> <TD width="134" height="25">5'h0</TD> <TD height="25">6'b100011</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>SW -- <I>Store word</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>The contents of $t is stored at the specified address. <TR> <TD>Operation: <TD>MEM[$s + imm] = $t; <TR> <TD>Syntax: <TD>sw $t, imm($s) <TR> <TD>Encoding: <TD> <TABLE border="1" width="507"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b101011</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5bit</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3><FONT color="#ff0000">SYSCALL -- System call</FONT></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Generates a software interrupt. <TR> <TD>Operation: <TD> <TR> <TD>Syntax: <TD>syscall <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="98" height="42">OPCODE</TD> <TD width="32" height="42">Source</TD> <TD width="82" height="42">Target</TD> <TD width="62" height="42">Destination</TD> <TD width="134" height="42">Shift</TD> <TD height="42">Function</TD> </TR> <TR> <TD width="98" height="25">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="25">?????</TD> <TD width="82" height="25">?????</TD> <TD width="62" height="25">?????</TD> <TD width="134" height="25">?????</TD> <TD height="25">6'b001100</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>XOR -- <I>Bitwise exclusive or</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Exclusive ors two registers and stores the result in a register <TR> <TD>Operation: <TD>$d = $s ^ $t; <TR> <TD>Syntax: <TD>xor $d, $s, $t <TR> <TD>Encoding: <TD> <TABLE border="1" width="476"> <TBODY> <TR> <TD width="98" height="42">OPCODE</TD> <TD width="32" height="42">Source</TD> <TD width="82" height="42">Target</TD> <TD width="62" height="42">Destination</TD> <TD width="134" height="42">Shift</TD> <TD height="42">Function</TD> </TR> <TR> <TD width="98" height="25">6fb‚O‚O‚O‚O‚O‚O</TD> <TD width="32" height="25">5bit</TD> <TD width="82" height="25">5bit</TD> <TD width="62" height="25">5bit</TD> <TD width="134" height="25">?????</TD> <TD height="25">6'b100110</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <H3>XORI -- <I>Bitwise exclusive or immediate</I></H3> <TABLE border=1> <TBODY> <TR> <TD>Description: <TD>Bitwise exclusive ors a register and an immediate value and stores the result in a register <TR> <TD>Operation: <TD>$t = $s ^ imm; <TR> <TD>Syntax: <TD>xori $t, $s, imm <TR> <TD>Encoding: <TD> <TABLE border="1" width="577"> <TBODY> <TR> <TD width="93" height="35">OPCODE</TD> <TD width="25" height="35">Source</TD> <TD width="82" height="35">Target</TD> <TD colspan="4">Immediate</TD> </TR> <TR> <TD width="93" height="30"><CODE>6'b001110</CODE></TD> <TD width="25" height="30">5bit</TD> <TD width="82" height="30">5bit</TD> <TD colspan="4">16bit</TD> </TR> </TBODY> </TABLE> </TR> </TBODY> </TABLE> <P><BR> <BR> </P> </BODY> </HTML>