Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
bc7c1f01
Commit
bc7c1f01
authored
Sep 30, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sh and sb
parent
1e5a4a97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
MIPS.sol
contracts/MIPS.sol
+10
-1
No files found.
contracts/MIPS.sol
View file @
bc7c1f01
...
@@ -183,7 +183,16 @@ contract MIPS {
...
@@ -183,7 +183,16 @@ contract MIPS {
return (mem >> (16-(rs&2)*8)) & 0xFFFF;
return (mem >> (16-(rs&2)*8)) & 0xFFFF;
} else if (opcode == 0x26) { // lwr
} else if (opcode == 0x26) { // lwr
return rt&0xFFFF0000 | mem&0xFFFF;
return rt&0xFFFF0000 | mem&0xFFFF;
} else if (opcode&0x3c == 0x28) { return rt; // sb, sh, sw
} else if (opcode == 0x28) { // sb
uint32 val = (rt&0xFF) << (24-(rs&3)*8);
uint32 mask = 0xFFFFFFFF ^ uint32(0xFF << (24-(rs&3)*8));
return (mem & mask) | val;
} else if (opcode == 0x29) { // sh
uint32 val = (rt&0xFFFF) << (16-(rs&2)*8);
uint32 mask = 0xFFFFFFFF ^ uint32(0xFFFF << (16-(rs&2)*8));
return (mem & mask) | val;
} else if (opcode == 0x2b) { // sw
return rt;
} else if (opcode == 0xf) { return rt<<16; // lui
} else if (opcode == 0xf) { return rt<<16; // lui
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment