From cf31258c39a991c1db4b3662ede227867c812d97 Mon Sep 17 00:00:00 2001 From: Pineapples <91441379+IHatePineapples@users.noreply.github.com> Date: Tue, 7 May 2024 03:27:06 +0100 Subject: [PATCH] Fix bad parsing for instructions starting with s --- src/fs/index.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/fs/index.html b/src/fs/index.html index 72f7906..c53c8fc 100644 --- a/src/fs/index.html +++ b/src/fs/index.html @@ -427,17 +427,16 @@

RISC-V Online

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]; }