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

Robert Gault robert.gault at att.net
Sat Jan 29 01:10:54 EST 2022


Sorry about that. My cellphone trashed the line feeds. Maybe this will work. 
   ldx ,s    leax -1,s    stx ,s 
Bad code might be 
   ldx ,s    leax -1,x    stx ,s 
Or depending on what is in regS 
   leas -1,s 
The comments suggest that regS is a pointer to a 16bit value so the second sequence should be the correct one.

Sent from AT&T Yahoo Mail on Android 
 
  On Sat, Jan 29, 2022 at 1:02 AM, robert.gault at att.net<robert.gault at att.net> wrote:   Right, I just looked up what I think are the lines in question.      ldx ,s      leax -1,s      stx ,s The instruction is legitimate but the sequence makes no sense to me. The second instruction removes the result of the first. The comments with the code suggest that regS points to a value which is to be decreased. In that case the code should be      ldx ,s     leax -1,x     stx ,sIf regS held a value instead of a pointer, then one should just use      leas -1,s Sent from my LG Mobile

-- 
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco
  


More information about the Coco mailing list