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

Johann Klasek johann+coco at klasek.at
Tue Feb 1 14:30:40 EST 2022


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. ;)





More information about the Coco mailing list