[Coco] Apparent discrepancy between MAME and XRoar re: SBCB instruction

Barry Nelson barry.nelson at amobiledevice.com
Wed Oct 18 20:08:56 EDT 2017


> Ron Klein
> Wed Oct 18 19:35:38 EDT 2017
> 
> Hi Tim,
> 
> Great to see you are still around!  I was asking Boisy about you at Tandy
> Assembly.  In any case, did you submit the your findings to mametesters?
> 
> Thanks
> 
> -Ron

Already submitted and fixed…

--- src/devices/cpu/m6809/base6x09.ops	2017-10-18 19:44:45.000000000 -0400
+++ src/devices/cpu/m6809/base6x09.ops	2017-10-18 19:53:07.000000000 -0400
@@ -239,8 +239,8 @@
 	return;
 
 SBC8:
-	m_temp.w = (uint16_t)read_operand() + (m_cc & CC_C ? 1 : 0);
-	regop8() = set_flags(CC_NZVC, regop8(), m_temp.b.l, regop8() - m_temp.w);
+	m_temp.b.l = read_operand();
+	regop8() = set_flags(CC_NZVC, regop8(), m_temp.b.l, regop8() - m_temp.b.l - (m_cc & CC_C ? 1 : 0));
 	return;
 
 AND8:
@@ -259,8 +259,8 @@
 	return;
 
 ADC8:
-	m_temp.w = (uint16_t)read_operand() + (m_cc & CC_C ? 1 : 0);
-	regop8() = set_flags(add8_sets_h() ? CC_HNZVC : CC_NZVC, regop8(), m_temp.b.l, regop8() + m_temp.w);
+	m_temp.b.l = read_operand();
+	regop8() = set_flags(add8_sets_h() ? CC_HNZVC : CC_NZVC, regop8(), m_temp.b.l, regop8() + m_temp.b.l + (m_cc & CC_C ? 1 : 0));
 	return;
 
 OR8:




More information about the Coco mailing list