[Coco] Errors in Leventhal's 6809 Subroutines book?

Joel Rees joel.rees at gmail.com
Tue Feb 1 23:38:02 EST 2022


2022年2月2日(水) 4:45 Johann Klasek <johann+coco at klasek.at>:

> On Sun, Jan 30, 2022 at 12:21:28PM +0900, Joel Rees wrote:
> [..]
> > Here's the nitty-gritty:
> [..]
> > -------- line 162 of MPBMUL.s --------
> >
> > 160:SETUP:
> > 161:  LDX    ,S        ; GET SHIFT COUNT
> > 162:  LEAX    -1,S        ; DECREMENT SHIFT COUNT BY 1
> > 163:  STX    ,S
> > 164:  BNE    SHFTST        ; CONTINUE UNLESS SHIFT COUNT EXHAUSTED
> >
> > As a simple fix, add one line:
> >
> > 160:SETUP:
> > 161:  LDX    ,S        ; GET SHIFT COUNT
> > 162:  LEAX    -1,X        ; DECREMENT SHIFT COUNT BY 1
> > 163:  STX    ,S
> > 164:  BNE    SHFTST        ; CONTINUE UNLESS SHIFT COUNT EXHAUSTED
> >
> > Note that both LEAX and STX set the Z flag, so that is not a problem
> here.
> >
> > -------- end line 162 of MPBMUL.s --------
>
> Probably some kind of copy&paste error,
> the above is part of 6809_MPBDIV.s, not of MPBMUL.s. ;)
>

Yeah, as you surmise.

I was falling asleep when I wrote that.


More information about the Coco mailing list