[Coco] assembly question

Barry Nelson barry.nelson at amobiledevice.com
Sun Aug 9 17:39:11 EDT 2015


At the current time, bge appears to work and exits the loop when b is decremented below zero and rolls over and the routine does find the CoCoSDC in all 4 slots. I have tested this for the CoCoSDC in each of the 4 slots and with no CoCoSDC present.

On Aug 9, 2015, at 4:45 PM, coco-request at maltedmedia.com wrote:

> Date: Sun, 09 Aug 2015 15:30:59 -0500
> From: "camillus" <camillus.b.58 at gmail.com>
> To: "Gabriel Holland via Coco" <coco at maltedmedia.com>
> Subject: Re: [Coco] assembly question
> Message-ID: <cd37a4a2-7c55-4c91-8da5-4c74cd7cc286 at getmailbird.com>
> Content-Type: text/plain; charset="utf-8"
> 
> hi my $0.02 worth.
> 
> I looked up in the 6809 instructions and DEC B (A) does not change the carrybit.
> 
> Also the BCC and/or BGE are testing the carry bit, not the value of the counter in B.  
> 
> BCC ( Branch if Carry Clear ) will only branch when the carry is 0.
> 
> BGE ( Branch Greater or Equal to zero ) which will always branch because it is either 1 ( greater then 0 ) or 0 ( equal with zero )
> 
> So to make this work I would test the content in B with COMB, #0 which will set carrybit when true and then BNE ( Branch Not Equal to zero ) as next instruction, ofcource needs to branch out of the loop in this case.
>  So if you really want to have 4 itterations 0-3 then you have to start at 4 because zero would take u out.
> 
> The reason that you exit the loop, I think is because the counter B goes down to zero, and I do not know if it can go negative. My guess is that somehow the carry get set by the fact B try's to go lower then zero.
> 
> Do not take this info as the holy grail, it was just my thoughts, and I am just human, prone to error or mistakes...lol



More information about the Coco mailing list