Skip to content

Commit

Permalink
Fix bad parsing for instructions starting with s
Browse files Browse the repository at this point in the history
  • Loading branch information
IHatePineapples committed May 7, 2024
1 parent ad44c83 commit cf31258
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/fs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -427,17 +427,16 @@ <h1>RISC-V Online</h1>
var rs2 = "";
var imm = "";

rd = tokens[1];
switch (tokens.length) {
case 3:
rd = tokens[1];
imm = tokens[2];
break;
case 4:
if (opc_0_6[0] == "b" || opc_0_6[0] == "s") {
if (opc_0_6[0] == "b" || (opc_0_6[0] == "s" && opc_0_6.length === 2)) {
rs1 = tokens[1];
imm = tokens[2];
} else {
rd = tokens[1];
rs1 = tokens[2];
imm = tokens[3];
}
Expand Down

0 comments on commit cf31258

Please sign in to comment.