Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4d7f54b

Browse files
Merge pull request#18 from robertmorelli/main
Add code field to instructions
2 parents9d1024d +83c3ff2 commit4d7f54b

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

‎mars/mips/instructions/BasicInstruction.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ public BasicInstruction(String example, BasicInstructionFormat instrFormat,
9696
* bit position in the 32-bit machine instruction. Operation codes and
9797
* unused bits are represented in the mask by 1's and 0's. Operand codes
9898
* are represented by 'f', 's', and 't' for bits occupied by first, secon
99-
* and third operand, respectively.
99+
* and third operand, respectively. The code 'c' is used for code fields
100+
* which are ignored by hardware.
100101
*
101102
* @return The 32 bit mask, as a String
102103
*/

‎mars/mips/instructions/InstructionSet.java‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ public void simulate(ProgramStatement statement) throws ProcessingException
11881188
newBasicInstruction("syscall",
11891189
"Issue a system call : Execute the system call specified by value in $v0",
11901190
BasicInstructionFormat.R_FORMAT,
1191-
"00000000000 00000 00000 00000 001100",
1191+
"000000ccccc ccccc ccccc ccccc 001100",
11921192
newSimulationCode()
11931193
{
11941194
publicvoidsimulate(ProgramStatementstatement)throwsProcessingException
@@ -2829,7 +2829,7 @@ public void simulate(ProgramStatement statement) throws ProcessingException
28292829
newBasicInstruction("teq $t1,$t2",
28302830
"Trap if equal : Trap if $t1 is equal to $t2",
28312831
BasicInstructionFormat.R_FORMAT,
2832-
"000000 fffff sssss00000 00000 110100",
2832+
"000000 fffff sssssccccc ccccc 110100",
28332833
newSimulationCode()
28342834
{
28352835
publicvoidsimulate(ProgramStatementstatement)throwsProcessingException
@@ -2863,7 +2863,7 @@ public void simulate(ProgramStatement statement) throws ProcessingException
28632863
newBasicInstruction("tne $t1,$t2",
28642864
"Trap if not equal : Trap if $t1 is not equal to $t2",
28652865
BasicInstructionFormat.R_FORMAT,
2866-
"000000 fffff sssss00000 00000 110110",
2866+
"000000 fffff sssssccccc ccccc 110110",
28672867
newSimulationCode()
28682868
{
28692869
publicvoidsimulate(ProgramStatementstatement)throwsProcessingException
@@ -2897,7 +2897,7 @@ public void simulate(ProgramStatement statement) throws ProcessingException
28972897
newBasicInstruction("tge $t1,$t2",
28982898
"Trap if greater or equal : Trap if $t1 is greater than or equal to $t2",
28992899
BasicInstructionFormat.R_FORMAT,
2900-
"000000 fffff sssss00000 00000 110000",
2900+
"000000 fffff sssssccccc ccccc 110000",
29012901
newSimulationCode()
29022902
{
29032903
publicvoidsimulate(ProgramStatementstatement)throwsProcessingException
@@ -2914,7 +2914,7 @@ public void simulate(ProgramStatement statement) throws ProcessingException
29142914
newBasicInstruction("tgeu $t1,$t2",
29152915
"Trap if greater or equal unsigned : Trap if $t1 is greater than or equal to $t2 using unsigned comparision",
29162916
BasicInstructionFormat.R_FORMAT,
2917-
"000000 fffff sssss00000 00000 110001",
2917+
"000000 fffff sssssccccc ccccc 110001",
29182918
newSimulationCode()
29192919
{
29202920
publicvoidsimulate(ProgramStatementstatement)throwsProcessingException
@@ -2972,7 +2972,7 @@ public void simulate(ProgramStatement statement) throws ProcessingException
29722972
newBasicInstruction("tlt $t1,$t2",
29732973
"Trap if less than: Trap if $t1 less than $t2",
29742974
BasicInstructionFormat.R_FORMAT,
2975-
"000000 fffff sssss00000 00000 110010",
2975+
"000000 fffff sssssccccc ccccc 110010",
29762976
newSimulationCode()
29772977
{
29782978
publicvoidsimulate(ProgramStatementstatement)throwsProcessingException
@@ -2989,7 +2989,7 @@ public void simulate(ProgramStatement statement) throws ProcessingException
29892989
newBasicInstruction("tltu $t1,$t2",
29902990
"Trap if less than unsigned : Trap if $t1 less than $t2, unsigned comparison",
29912991
BasicInstructionFormat.R_FORMAT,
2992-
"000000 fffff sssss00000 00000 110011",
2992+
"000000 fffff sssssccccc ccccc 110011",
29932993
newSimulationCode()
29942994
{
29952995
publicvoidsimulate(ProgramStatementstatement)throwsProcessingException

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp