Make move from SR privileged

This commit is contained in:
pjht 2024-03-13 10:24:48 -05:00
parent 74584bc076
commit 44f821b12e
Signed by: pjht
GPG Key ID: CA239FC6934E6F3A

View File

@ -540,6 +540,10 @@ impl M68K {
self.write_effective(dst, u32::from(self.sr & 0xFF), Size::Word)?; self.write_effective(dst, u32::from(self.sr & 0xFF), Size::Word)?;
} }
Instruction::MoveFromSr(dst) => { Instruction::MoveFromSr(dst) => {
if !self.is_supervisor() {
self.trap(8)?;
return Err(InsExecError::AbnormalTrap);
}
self.write_effective(dst, u32::from(self.sr), Size::Word)?; self.write_effective(dst, u32::from(self.sr), Size::Word)?;
} }
Instruction::MoveToCcr(src) => { Instruction::MoveToCcr(src) => {