Update examples/exercises/8p6/8p6.S

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
David Harris 2025-05-27 04:04:02 -07:00 committed by GitHub
parent 11ff08d0ac
commit 0a4e70339a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -60,7 +60,7 @@ trap_handler:
# check if instruction is mul (op = 0110011, funct3 = 000, funct7 = 0000001) # check if instruction is mul (op = 0110011, funct3 = 000, funct7 = 0000001)
csrr t0, mtval # fetch instruction that caused trap csrr t0, mtval # fetch instruction that caused trap
andi t1, t0, 127 # get op field (instr[7:0]) andi t1, t0, 127 # get op field (instr[6:0])
xori t1, t1, 0b0110011 # set to 0 if op is 0110011 xori t1, t1, 0b0110011 # set to 0 if op is 0110011
srli t2, t0, 12 # get funct3 field (instr[14:12]) srli t2, t0, 12 # get funct3 field (instr[14:12])
andi t2, t2, 7 # mask off other bits. Should be 0 if funct3 = 000 andi t2, t2, 7 # mask off other bits. Should be 0 if funct3 = 000