Skip to content

Commit

Permalink
Remove a tautology DEV_PSR is always >= xFE00.
Browse files Browse the repository at this point in the history
  • Loading branch information
TricksterGuy authored Jun 6, 2022
1 parent 6511d52 commit 4346b81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions liblc3/lc3_execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ short lc3_mem_read(lc3_state& state, unsigned short addr, bool privileged)
state.mem[DEV_PSR] = (short)((state.privilege << 15) | (state.priority << 8) | (state.n << 2) | (state.z << 1) | state.p);
} else
{
if (addr >= 0xFE00U && state.address_plugins.find(addr) != state.address_plugins.end())
if (state.address_plugins.find(addr) != state.address_plugins.end())
return state.address_plugins[addr]->OnRead(state, addr);
else if (!kernel_mode)
// Warn if reading from reserved memory if you aren't in kernel mode
Expand Down Expand Up @@ -802,7 +802,7 @@ void lc3_mem_write(lc3_state& state, unsigned short addr, short value, bool priv
lc3_warning(state, LC3_RESERVED_MEM_WRITE, addr, 0);
/// TODO consider allowing writing to the PSR.
} else {
if (addr >= 0xFE00U && state.address_plugins.find(addr) != state.address_plugins.end())
if (state.address_plugins.find(addr) != state.address_plugins.end())
return state.address_plugins[addr]->OnWrite(state, addr, value);
else if (!kernel_mode)
lc3_warning(state, LC3_RESERVED_MEM_WRITE, value, addr);
Expand Down

0 comments on commit 4346b81

Please sign in to comment.