Viewing Issue Advanced Details
|ID||Category [?]||Severity [?]||Reproducibility||Date Submitted||Last Update|
|06719||Core||Minor||Always||Oct 18, 2017, 00:55||Oct 18, 2017, 22:25|
|Tester||star2root||View Status||Public||Platform||MAME (Self-compiled)|
|Version||0.187||Fixed in Version||0.191||Build|
|Summary||06719: coco12, coco3, other 6809?: SBCB instruction returns the wrong result|
Run the following program and look at the number that appears on the line before the final OK prompt (on the 32x16 screen).
On MAME 0.187, it's 7 while on the physical machine, it's 5. This value shows the N, Z,
V and C flags that result from the SBCB instruction. The two values mean
that MAME's SBCB set the V (overflow) flag to 1, while the physical machine set it to 0.
I also tested on MAME 0.140, and it gave 5, interestingly.
The assembly source is the following:
andcc #$00 ; clear all flags
orcc #$01 ; set carry
sbcb #$FF ; $00 - $ff - 1 = $00
sta $400 ; store resulting CC on 32x16 screen
It can be assembled with LWTOOLS like this:
lwasm -fdecb -o sbc.bin sbc.asm
There is also a prepared a disk image with the Basic program on it:
|Steps To Reproduce||Run the code in the description on the emulator.|
|Flags||Verified with Original|
|Affected Sets / Systems||coco12, coco3, other 6809?|
|There are no relationship linked to this issue.|
Oct 18, 2017, 12:29
Updated regression version
Appears related to 6809 core rewrite:
Oct 18, 2017, 15:54
The issue is that the + here should be a - :
Credit goes to Pierre Sarrazin and Tim Lindner for investigating/finding this bug.