Skip to content

Commit a72f7fd

Browse files
William SongWilliam Song
authored andcommitted
uj
1 parent c9b0484 commit a72f7fd

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

UPDATE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ Update history:
103103
registers, ALU, and data memory are empty.
104104

105105
* Version 1.7 (April 26, 2020)
106+
- A bug is fixed in inst_memory.cc when parsing UJ-type instruction
107+
(i.e., jal).
106108
- A redundant condition in proc_t::fetch() is removed. It checked if inst
107109
was valid before get_op_type(inst->op) == op_sb_type for conditional
108110
branches. It was unnecessary since the this line of code was never

inst_memory.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,13 @@ void inst_memory_t::parse_inst_str(std::string m_inst_str, size_t m_line_num) {
217217
<< " at line #" << m_line_num << endl;
218218
exit(1);
219219
}
220-
if(!is_reg_str(args[1]) || !is_num_str(args[2])) {
220+
if(!is_reg_str(args[1])) {
221221
cerr << "Error: invalid instruction format: " << m_inst_str
222222
<< " at line #" << m_line_num << endl;
223223
exit(1);
224224
}
225225
inst.rd_num = get_regnum(args[1]);
226-
inst.imm = get_imm(args[2]);
227-
inst.label = args[3];
226+
inst.label = args[2];
228227
break;
229228
}
230229
default: { break; } // Nothing to do

0 commit comments

Comments
 (0)