fix instruction decode

This commit is contained in:
2021-07-09 07:37:12 +02:00
parent 473f8a5a17
commit e68918c2e8
3 changed files with 78 additions and 100 deletions

View File

@ -144,10 +144,10 @@ public:
mstatus_t mstatus;
static const reg_t mstatus_reset_val = 0;
static const reg_t mstatus_reset_val = 0x1800;
void write_mstatus(T val) {
auto mask = get_mask();
auto mask = get_mask() &0xff; // MPP is hardcode as 0x3
auto new_val = (mstatus.backing.val & ~mask) | (val & mask);
mstatus = new_val;
}