[Coco] Bug in VCC ???

Luis Antoniosi (CoCoDemus) retrocanada76 at gmail.com
Wed Apr 16 12:39:09 EDT 2014


More info: MBASIC.COM does not work properly too. If I do:

print 1/3

division by zero.

I think it's a similar problem the the CoCoFPGA.


On Wed, Apr 16, 2014 at 12:34 PM, Luis Antoniosi (CoCoDemus) <
retrocanada76 at gmail.com> wrote:

> One note here: it's the Z-80 code that goes crazy not the cp/m virtual
> machine. The cp/m vm still keeps working fetching and running each
> instruction.
>
> How the VM works, suppose you have a instruction like INC L in Z-80 I will
> use the 6809 counter part, so the implementation is:
>
> INCL inc <L
> tfr cc,b
>  lbsr _inc8
> lbra _fetch
>
> _inc8 lda <F
>  anda #~(SF|ZF|HF|PF|NF) * clean Z80 flags
> andb #~(M_CF|M_HF)      * clean M6809 flags
>  leay FLAGTBL,pcr
> ora b,y
>  sta <F
> rts
>
> So FLAGTBL has 256 entries converting each 6809 flag combination to the
> Z-80 ones. Some 6809 don't set/unset the same flags on Z-80 so extra code
> is needed to set them. I suspect that VCC is setting/unsetting a flag that
> wasn't supposed to be set and the next conditional jump that relies on it
> goes to the wrong place.
>
>
> On Wed, Apr 16, 2014 at 12:15 PM, Luis Antoniosi (CoCoDemus) <
> retrocanada76 at gmail.com> wrote:
>
>> I noticed the VCC 1.43beta won't run my cpm emulator running zork1.comproperly.
>>
>> It seem to get a wrong conditional jump and goes crazy scrolling the
>> screen up.
>>
>> The same image DOES work on MESS and a real Coco3. The Mbasic.com
>> seemed at beginning to work fine.
>>
>> I'm using a direct lookup table to convert 6809 flags to Z-80 flags.
>> So it could be the case some instruction setting or resetting a wrong
>> flag.
>>
>> I have no clue which instruction is that since I don't use VCC (it
>> does not have a debugger it has no purpose for me).
>>
>> The cpm disks:
>>
>>
>> https://sites.google.com/site/tandycocoloco/dropbox/cpm-os9.zip?attredirects=0&d=1
>>
>> Mount zork.os9 (80T disk image) and run
>>
>> /d1/cpm zork1.com
>>
>> And you will see the bug right away.
>>
>>
>> --
>> Long live the CoCo
>>
>
>
>
> --
> Long live the CoCo
>



-- 
Long live the CoCo



More information about the Coco mailing list