INCB and CC...

A place to discuss everything Dragon related that doesn't fall into the other categories.
Post Reply
jedie
Posts: 655
Joined: Wed Aug 14, 2013 12:23 pm
Location: germany
Contact:

INCB and CC...

Post by jedie »

I compare some trace in my Emulator with the XRoar one.
For compare the CC values i add --add_cc in my add_info_in_trace.py with commit https://github.com/jedie/PyDragon32/com ... 2ad02c4c03

The thread here is about INCB and the CC flags. I saw this:

The XRoar trace:
9209| 46 RORA cc=84 a=00 b=ff dp=00 x=004f y=b39b u=03db s=7f28| E....Z.. | $9209: $8000-$9fff - CoCo - Extended Color BASIC ROM
920a| 5c INCB cc=84 a=00 b=00 dp=00 x=004f y=b39b u=03db s=7f28| E....Z.. | $920a: $8000-$9fff - CoCo - Extended Color BASIC ROM
920b| 26f4 BNE $9201 cc=84 a=00 b=00 dp=00 x=004f y=b39b u=03db s=7f28| E....Z.. | $920b: $8000-$9fff - CoCo - Extended Color BASIC ROM

DragonPy Emulator trace:
ed09| 46 RORA A=00 cc=84 a=00 b=ff dp=00 x=004f y=0000 u=01f2 s=0327 | E....Z.. | $ed09: $db00-$ffff - BASIC Interpreter
ed0a| 5c INCB B=00 cc=86 a=00 b=00 dp=00 x=004f y=0000 u=01f2 s=0327 | E....ZV. | $ed0a: ADD ONE TO EXPONENT DIFFERENCE
ed0b| 26 BNE ea:ed01 cc=86 a=00 b=00 dp=00 x=004f y=0000 u=01f2 s=0327 | E....ZV. | $ed0b: BRANCH IF EXPONENTS NOT =

B was $FF and INCB called. Look at the Overflow Flag V
XRoad didn't set V, why?
... too many ideas and too little time ... Related stuff written in Python:
Dragon 32 emulator / PyDC - Python Dragon 32 converter: https://github.com/jedie/DragonPy
DWLOAD server / Dragon-Lib and other stuff: https://github.com/6809
sixxie
Posts: 1348
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: INCB and CC...

Post by sixxie »

jedie wrote: B was $FF and INCB called. Look at the Overflow Flag V
XRoad didn't set V, why?
Because V indicates *signed* overflow - you're incrementing from -1 to 0.
User avatar
JeeK
Posts: 67
Joined: Fri Aug 16, 2013 10:45 am
Location: Vienna, Austria
Contact:

Re: INCB and CC...

Post by JeeK »

jedie wrote:I compare some trace in my Emulator with the XRoar one.
For compare the CC values i add --add_cc in my add_info_in_trace.py with commit https://github.com/jedie/PyDragon32/com ... 2ad02c4c03

The thread here is about INCB and the CC flags. I saw this:

[..]
DragonPy Emulator trace:
ed09| 46 RORA A=00 cc=84 a=00 b=ff dp=00 x=004f y=0000 u=01f2 s=0327 | E....Z.. | $ed09: $db00-$ffff - BASIC Interpreter
ed0a| 5c INCB B=00 cc=86 a=00 b=00 dp=00 x=004f y=0000 u=01f2 s=0327 | E....ZV. | $ed0a: ADD ONE TO EXPONENT DIFFERENCE
ed0b| 26 BNE ea:ed01 cc=86 a=00 b=00 dp=00 x=004f y=0000 u=01f2 s=0327 | E....ZV. | $ed0b: BRANCH IF EXPONENTS NOT =

B was $FF and INCB called. Look at the Overflow Flag V
XRoad didn't set V, why?
Xroar is right. The overflow condition is always related to signed value operations. For INC this happens only if 0x7f (127) overflows the positive value range and becomes 0x80 (128 or signed -128). Vice versa for DEC.
The dragon on my side: http://klasek.at/hc/dragon/
jedie
Posts: 655
Joined: Wed Aug 14, 2013 12:23 pm
Location: germany
Contact:

Re: INCB and CC...

Post by jedie »

... too many ideas and too little time ... Related stuff written in Python:
Dragon 32 emulator / PyDC - Python Dragon 32 converter: https://github.com/jedie/DragonPy
DWLOAD server / Dragon-Lib and other stuff: https://github.com/6809
Post Reply