カテゴリ 重要度 ステータス 解決状況 登録日時 最終更新
システムコア解決済み修正済み2017-10-18 09:552017-10-19 07:25
 
テスターstar2root担当者hapソースtrs/coco12.cpp
バージョン0.187発生バージョン0.148u2修正バージョン0.191
修正コミットプルリク
フラグ実機・資料検証済み
セット coco12, coco3, other 6809?
セット詳細
 
概 要SBCB命令が間違った結果を返す。
詳 細Run the following program and look at the number that appears on the line before the final OK prompt (on the 32x16 screen).

10 DATA5F,1C,00,1A,01,C2,FF
20 DATA34,01,35,02,B7,04,00,39
30 FORI=0TO14:READH$
40 POKE&H3800+I,VAL("&H"+H$)
50 NEXT
60 CLS:PRINT
70 EXEC&H3800
80 PRINTPEEK(1024)AND15

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:

org $3800
start
clrb
andcc #$00 ; clear all flags
orcc #$01 ; set carry
sbcb #$FF ; $00 - $ff - 1 = $00
pshs cc
puls a
sta $400 ; store resulting CC on 32x16 screen
rts
end start

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:
http://sarrazip.com/dev/sbc.dsk
再現手順Run the code in the description on the emulator.
追加情報 
 
添付ファイル