From 44f821b12e49a376f831acd737c34c3076d88727 Mon Sep 17 00:00:00 2001 From: pjht Date: Wed, 13 Mar 2024 10:24:48 -0500 Subject: [PATCH] Make move from SR privileged --- src/m68k.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/m68k.rs b/src/m68k.rs index c5e175a..8058d68 100644 --- a/src/m68k.rs +++ b/src/m68k.rs @@ -540,6 +540,10 @@ impl M68K { self.write_effective(dst, u32::from(self.sr & 0xFF), Size::Word)?; } Instruction::MoveFromSr(dst) => { + if !self.is_supervisor() { + self.trap(8)?; + return Err(InsExecError::AbnormalTrap); + } self.write_effective(dst, u32::from(self.sr), Size::Word)?; } Instruction::MoveToCcr(src) => {