From c607697b7a470d42f20f7fcafea1121d3d81ee79 Mon Sep 17 00:00:00 2001 From: pjht Date: Mon, 6 Nov 2023 12:19:15 -0600 Subject: [PATCH] Fix RTE popping the format word as a long --- src/m68k.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m68k.rs b/src/m68k.rs index 1617eb2..da2245a 100644 --- a/src/m68k.rs +++ b/src/m68k.rs @@ -626,7 +626,7 @@ impl M68K { Instruction::Rte => { self.sr = self.pop(Size::Word)? as u16; self.pc = self.pop(Size::Long)?; - let format = (self.pop(Size::Long)? & 0xf000) >> 12; + let format = (self.pop(Size::Word)? & 0xf000) >> 12; if format == 8 { let special_status_word = self.pop(Size::Long)?; let fault_address = self.pop(Size::Long)?;