[Coco] Errors in Leventhal's 6809 Subroutines book?
Joel Rees
joel.rees at gmail.com
Sat Jan 29 22:47:51 EST 2022
On Sun, Jan 30, 2022 at 1:57 AM Robert Gault <robert.gault at att.net> wrote:
>
> Here is a typical issue with the Leventhal book. He has clra clrb std ,s
> The first two lines are two cycles each but it could be:
> ldd #0 std ,s
> where ldd #0 is three cycles.
That actually is not one I would consider an issue. The code is, after
all, intended to teach assembly language using the 6809 as the target.
And the assembly language it is presenting is the common vernacular,
intended to translate to other CPUs as much as possible more than to
show optimal 6809 techniques.
At least that's how I interpret the preface.
(Speaking of the preface, I wonder, if we contacted the publisher now,
would they respond? Or -- I vaguely recall a loose sheet of errata in
my copy, which I believe is far across the ocean now.)
> He frequently does math operations on a stack item instead of a memory location without explaining why the more complex routine was chosen.
As mentioned in the preface he is demonstrating "standard" parameter
passing techniques.
(I personally detest that standard. Makes for a vulnerable stack.)
> I sugest entering some of the code in EDTASM and then running it in Zbug to see if the code works as claimed.
If that's what you meant before, that if one used EDTASM the error
would be found quickly, then I apologize for being obtuse. I had
assumed you were thinking the assembler would throw syntax error
messages.
> Sent from AT&T Yahoo Mail on Android
>
> On Sat, Jan 29, 2022 at 11:40 AM, michaelkline704 at gmail.com<michaelkline704 at gmail.com> wrote: Good Point! I did that when I learned BASIC years ago. The cool thing about Adobe CC; you can usually make changes and resave the book.
> Michael
>
> -----Original Message-----
> From: Coco <coco-bounces at maltedmedia.com> On Behalf Of Robert Gault
> Sent: 29 January 2022 10:21
> To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
> Subject: Re: [Coco] Errors in Leventhal's 6809 Subroutines book?
>
> You will find that many of the examples in the subroutine book are far from optimal and there are others that are bad. The obvious way to learn programming is not to assume the routines are good but to actually test them say with EDTASM and try to improve on them. You will quickly find that there are much better, simpler, and more direct ways to write many of the routines. Regards p78 if you want to decrease a 16 bit number, you could just
> subd #1
> RegB could be loaded from memory or from the stack. The point is to see what assumptions were made starting on p74.
> Sent from AT&T Yahoo Mail on Android
>
> If anyone comes up with a definitive/tested answer, I would like to know so that I can correct my copy of the book (if necessary). One of my desires is to learn ASM for the CoCo.
>
> Cheers!
> Michael
>
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
--
Joel Rees
http://reiisi.blogspot.jp/p/novels-i-am-writing.html
More information about the Coco
mailing list