[Coco] Mod10 Suggestions

William Mikrut wmikrut72 at gmail.com
Fri Feb 17 18:12:53 EST 2017


I see the math there... I am processing 16 numbers -- and I keep thinking
16.
However, the actual memory range populated is 1200 - 120F

Let me give it a try!


On Fri, Feb 17, 2017 at 5:04 PM, William Astle <lost at l-w.ca> wrote:

> On 2017-02-17 03:50 PM, William Mikrut wrote:
>
>> The reason being I am actually reading the number from right to left.
>> So I need that A,x   (16,X) then (15,X) and so on offset to process the
>> numbers.
>>
>> I don't know of another way to maintain that index while counting down.
>>
>
> Actually, I did make an error in my description. It should be BPL to
> branch when not negative so it keeps looping until DECA results in 255 (or
> -1). That's what I get for being distracted when I wrote the message.
>
> However, if you do exactly what I wrote (modulo the BMI/BPL error), you
> will have *exactly* the same result. That's because you're doing the DECA
> at the start of the loop so it doesn't change the conditions inside the
> loop if you start with A at 15 and do the decrementing at the end of the
> loop or start with A at 16 and do the decrementing at the start of the
> loop. Either way, A is still in the range of 0...15 during the loop.
>
> Basically, you have "LDA #15" at the start. Remove the DECA at "LOOP.00".
> Replace CMPA #0 (or TSTA) with "DECA" and change the "BNE LOOP.00" to "BPL
> LOOP.00". Unless I'm miscalculating that will save you one additional byte.
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>


More information about the Coco mailing list