Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

win-nt from the people who invented edlin. -- MaDsen Wikholm, mwikholm@at8.abo.fi


devel / comp.sys.apple2.programmer / Re: Typo in ProDOS refTechMan

SubjectAuthor
* Typo in ProDOS refTechManColin Leroy-Mira
+* Re: Typo in ProDOS refTechManJerry Penner
|`* Re: Typo in ProDOS refTechManColin Leroy-Mira
| `* Re: Typo in ProDOS refTechManOliver Schmidt
|  `* Re: Typo in ProDOS refTechManColin Leroy-Mira
|   `* Re: Typo in ProDOS refTechManJerry Penner
|    `* Re: Typo in ProDOS refTechManJeff Blakeney
|     `* Re: Typo in ProDOS refTechManMichael J. Mahon
|      +* Re: Typo in ProDOS refTechManJeff Blakeney
|      |`- Re: Typo in ProDOS refTechManMichael J. Mahon
|      `* Re: Typo in ProDOS refTechManPeter 'Shaggy' Haywood
|       `* Re: Typo in ProDOS refTechManMichael J. Mahon
|        +- Re: Typo in ProDOS refTechManAntoine Vignau
|        `- Re: Typo in ProDOS refTechManPeter 'Shaggy' Haywood
`* Re: Typo in ProDOS refTechManqkumba
 `- Re: Typo in ProDOS refTechManAntoine Vignau

1
Typo in ProDOS refTechMan

<20230822221945.4eb8a091@laptop-sigfox>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=346&group=comp.sys.apple2.programmer#346

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: col...@colino.net (Colin Leroy-Mira)
Newsgroups: comp.sys.apple2.programmer
Subject: Typo in ProDOS refTechMan
Date: Tue, 22 Aug 2023 22:19:45 +0200
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <20230822221945.4eb8a091@laptop-sigfox>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="cb7300d15943b67059c4672cf3eed23e";
logging-data="2695171"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rfVRFL5oIHdmFHWl62WyfglCcYFuUYFY="
Cancel-Lock: sha1:qobfcwPuB069hgzpoG59KDKUfSc=
X-Newsreader: Claws Mail 3.19.1git30 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
 by: Colin Leroy-Mira - Tue, 22 Aug 2023 20:19 UTC

Hi everyone,

I think there's a typo in the ProDOS Technical Reference Manual at
http://www.easy68k.com/paulrsm/6502/PDOS8TRM.HTM#4.2

In fact, "Upon completion of the call, the MLI returns to the address
of the JSR plus 6" - not 3.

Unless I'm mistaken.

HTH,
--
Colin
https://www.colino.net/

Re: Typo in ProDOS refTechMan

<yubzg2iicr9.fsf@jpen.ca>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=347&group=comp.sys.apple2.programmer#347

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jerry...@jpen.ca (Jerry Penner)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Typo in ProDOS refTechMan
Date: Tue, 22 Aug 2023 22:49:46 -0600
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <yubzg2iicr9.fsf@jpen.ca>
References: <20230822221945.4eb8a091@laptop-sigfox>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="d97d67af7148e04bab883a036efc647a";
logging-data="2944924"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+BQCM7/3esG/tsTK0V8ZTe"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:bvDu6H+IVi76wBuqoavA7pLpDck=
sha1:0QefsjO9XjLla8vYHhKIKZ00/84=
 by: Jerry Penner - Wed, 23 Aug 2023 04:49 UTC

Colin Leroy-Mira <colin@colino.net> writes:

> Hi everyone,
>
> I think there's a typo in the ProDOS Technical Reference Manual at
> http://www.easy68k.com/paulrsm/6502/PDOS8TRM.HTM#4.2
>
> In fact, "Upon completion of the call, the MLI returns to the address
> of the JSR plus 6" - not 3.
>
> Unless I'm mistaken.
>
> HTH,

I think you're right. What ProDOS does is add 3 bytes to the return
address to pass over the command-number and command-list-address, but
the effect is that execution continues 6 bytes after the start of the
JSR instruction. I have read that page many times and never noticed
that, probably because I understood what was going on with the
return-address.

Nice catch.

--
--
Jerry jerry+a2 at jpen.ca

Re: Typo in ProDOS refTechMan

<20230823082311.3dc76fb1@laptop-sigfox>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=348&group=comp.sys.apple2.programmer#348

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: col...@colino.net (Colin Leroy-Mira)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Typo in ProDOS refTechMan
Date: Wed, 23 Aug 2023 08:23:11 +0200
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <20230823082311.3dc76fb1@laptop-sigfox>
References: <20230822221945.4eb8a091@laptop-sigfox>
<yubzg2iicr9.fsf@jpen.ca>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="f33b06f7ea60010ca315cb4717b74dc7";
logging-data="2695171"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/IrSe2nmrD05wRfqIKb599twKKYOVWHpk="
Cancel-Lock: sha1:dIGaR7346VfjyxImBrwvKZzpz3g=
X-Newsreader: Claws Mail 3.19.1git30 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
 by: Colin Leroy-Mira - Wed, 23 Aug 2023 06:23 UTC

Hi,

>I think you're right. What ProDOS does is add 3 bytes to the return
>address to pass over the command-number and command-list-address, but
>the effect is that execution continues 6 bytes after the start of the
>JSR instruction. I have read that page many times and never noticed
>that, probably because I understood what was going on with the
>return-address.

I only noticed it because I couldn't see it returning by looking for
its return point when adding 3 to the address where it was called :)
--
Colin
https://www.colino.net/

Re: Typo in ProDOS refTechMan

<uc4d2e$4ofj$1@solani.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=349&group=comp.sys.apple2.programmer#349

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: ol....@web.de (Oliver Schmidt)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Typo in ProDOS refTechMan
Date: Wed, 23 Aug 2023 07:38:54 -0000 (UTC)
Message-ID: <uc4d2e$4ofj$1@solani.org>
References: <20230822221945.4eb8a091@laptop-sigfox>
<yubzg2iicr9.fsf@jpen.ca>
<20230823082311.3dc76fb1@laptop-sigfox>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 23 Aug 2023 07:38:54 -0000 (UTC)
Injection-Info: solani.org;
logging-data="156147"; mail-complaints-to="abuse@news.solani.org"
User-Agent: NewsTap/5.5 (iPhone/iPod Touch)
Cancel-Lock: sha1:bx6rpjy9oGwvf5sz6eju4cg8aV8= sha1:ooxs29nmsb1s45h9JJbcgxYizGo=
X-User-ID: eJwFwYEBwDAEBMCVCF6NI+T3H6F3YVBMOgIeDM7e7pdjdED1xNESlFzxL7ObW29kjaUDp/4iyBEq
 by: Oliver Schmidt - Wed, 23 Aug 2023 07:38 UTC

Colin Leroy-Mira <colin@colino.net> wrote:
> Hi,
>
>> I think you're right. What ProDOS does is add 3 bytes to the return
>> address to pass over the command-number and command-list-address, but
>> the effect is that execution continues 6 bytes after the start of the
>> JSR instruction. I have read that page many times and never noticed
>> that, probably because I understood what was going on with the
>> return-address.
>
> I only noticed it because I couldn't see it returning by looking for
> its return point when adding 3 to the address where it was called :)

I - pretty strongly - disagree. What JSR does is an implementation detail.
What the documentation wants to express is that MLI returns 3 bytes
"behind" what a "bare" JSR returns to. Putting a 6 there instead of a 3 is
plainly wrong.

Re: Typo in ProDOS refTechMan

<20230823152214.5e86230e@laptop-sigfox>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=350&group=comp.sys.apple2.programmer#350

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: col...@colino.net (Colin Leroy-Mira)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Typo in ProDOS refTechMan
Date: Wed, 23 Aug 2023 15:22:14 +0200
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <20230823152214.5e86230e@laptop-sigfox>
References: <20230822221945.4eb8a091@laptop-sigfox>
<yubzg2iicr9.fsf@jpen.ca>
<20230823082311.3dc76fb1@laptop-sigfox>
<uc4d2e$4ofj$1@solani.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="f33b06f7ea60010ca315cb4717b74dc7";
logging-data="2695171"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+fr/NR8/TmeIcgStz5axkELJtiVjRZKdw="
Cancel-Lock: sha1:374xJ4nimb/iuFy3HYKonIWWllU=
X-Newsreader: Claws Mail 3.19.1git30 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
 by: Colin Leroy-Mira - Wed, 23 Aug 2023 13:22 UTC

Hi,

>I - pretty strongly - disagree. What JSR does is an implementation
>detail. What the documentation wants to express is that MLI returns 3
>bytes "behind" what a "bare" JSR returns to. Putting a 6 there instead
>of a 3 is plainly wrong.

I see what you mean, but the original phrasing is confusing. It could
be "the MLI returns 3 bytes behind than a normal JSR does, to the
address of the JSR plus 6".

--
Colin
https://www.colino.net/

Re: Typo in ProDOS refTechMan

<yubr0ntht3u.fsf@jpen.ca>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=351&group=comp.sys.apple2.programmer#351

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jerry...@jpen.ca (Jerry Penner)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Typo in ProDOS refTechMan
Date: Thu, 24 Aug 2023 00:06:29 -0600
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <yubr0ntht3u.fsf@jpen.ca>
References: <20230822221945.4eb8a091@laptop-sigfox> <yubzg2iicr9.fsf@jpen.ca>
<20230823082311.3dc76fb1@laptop-sigfox> <uc4d2e$4ofj$1@solani.org>
<20230823152214.5e86230e@laptop-sigfox>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="7f060383c7068ef65cd47db60af32beb";
logging-data="3535695"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186gr7NDVM5qA3KRMigRqRV"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:QbQFrRfbthwNmWukI91nKz10/aM=
sha1:4tv3oj2/zxV0D1PU89Edpb57YXY=
 by: Jerry Penner - Thu, 24 Aug 2023 06:06 UTC

Colin Leroy-Mira <colin@colino.net> writes:

> Hi,
>
>> Oliver Schmidt <ol.sc@web.de> wrote:
>>I - pretty strongly - disagree. What JSR does is an implementation
>>detail. What the documentation wants to express is that MLI returns 3
>>bytes "behind" what a "bare" JSR returns to. Putting a 6 there instead
>>of a 3 is plainly wrong.
>
> I see what you mean, but the original phrasing is confusing. It could
> be "the MLI returns 3 bytes behind than a normal JSR does, to the
> address of the JSR plus 6".

The P8 tech-ref states:

----------------------------------------
SYSCALL JSR MLI ;Call Command Dispatcher
DB CMDNUM ;This determines which call is being made
DW CMDLIST ;A two-byte pointer to the parameter list
BNE ERROR ;Error if nonzero

Upon completion of the call, the MLI returns to the address of the
JSR plus 3 (in the above example, the BNE statement); the call
number and parameter list pointer are skipped.
----------------------------------------

Where the CPU returns to is 6 bytes past the label SYSCALL, which is the
location of the "BNE ERROR" instruction.

I think I always read and understood the book the way I think Oliver
does, but I think the book's address arithmetic is wrong, looking at it
now.

--
--
Jerry jerry+a2 at jpen.ca

Re: Typo in ProDOS refTechMan

<uc7hb2$3f3vg$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=352&group=comp.sys.apple2.programmer#352

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: CUTjeffr...@yahoo.ca (Jeff Blakeney)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Typo in ProDOS refTechMan
Date: Thu, 24 Aug 2023 08:10:11 -0400
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <uc7hb2$3f3vg$1@dont-email.me>
References: <20230822221945.4eb8a091@laptop-sigfox> <yubzg2iicr9.fsf@jpen.ca>
<20230823082311.3dc76fb1@laptop-sigfox> <uc4d2e$4ofj$1@solani.org>
<20230823152214.5e86230e@laptop-sigfox> <yubr0ntht3u.fsf@jpen.ca>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 24 Aug 2023 12:10:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e17f87f6521bfc1cc1f92c5cad69d279";
logging-data="3641328"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18X0qA9xW4gMGsLFQAMz7Ioq2GzPOxzwH0="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:Kt6NQkb4B0/GGpuy9QLAjmIlft8=
Content-Language: en-CA
In-Reply-To: <yubr0ntht3u.fsf@jpen.ca>
 by: Jeff Blakeney - Thu, 24 Aug 2023 12:10 UTC

On 2023-08-24 2:06 a.m., Jerry Penner wrote:
> Colin Leroy-Mira <colin@colino.net> writes:
>
> The P8 tech-ref states:
>
> ---------------------------------------- SYSCALL JSR MLI ;Call
> Command Dispatcher DB CMDNUM ;This determines which call is being
> made DW CMDLIST ;A two-byte pointer to the parameter list BNE
> ERROR ;Error if nonzero
>
> Upon completion of the call, the MLI returns to the address of the
> JSR plus 3 (in the above example, the BNE statement); the call number
> and parameter list pointer are skipped.
> ----------------------------------------
>
> Where the CPU returns to is 6 bytes past the label SYSCALL, which is
> the location of the "BNE ERROR" instruction.
>
> I think I always read and understood the book the way I think Oliver
> does, but I think the book's address arithmetic is wrong, looking at
> it now.
As far as I remember my 6502 assembly, when you do a JSR, the processor
has already read the JSR byte and the two byte address so the PC is
pointing at the DB CMDNUM statement and that is what is pushed on the
stack. The MLI pulls that address off the stack, adds 3 to it, pushes
it back on the stack and does an RTS so that the BNE ERROR statement
will get executed.

In other words, the SYSCALL is the address of the JSR but it isn't the
address that gets pushed onto the stack when the JSR is executed.

Re: Typo in ProDOS refTechMan

<a8qdndVgG6oR33H5nZ2dnZfqnPWdnZ2d@giganews.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=353&group=comp.sys.apple2.programmer#353

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 28 Aug 2023 06:45:32 +0000
User-Agent: NewsTap/5.5 (iPhone/iPod Touch)
Cancel-Lock: sha1:O309nFECNS/s0WOhB/SdHgufosY=
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Typo in ProDOS refTechMan
Content-Type: text/plain; charset=UTF-8
Mime-Version: 1.0
Content-Transfer-Encoding: 8bit
From: mjma...@aol.com (Michael J. Mahon)
References: <20230822221945.4eb8a091@laptop-sigfox>
<yubzg2iicr9.fsf@jpen.ca>
<20230823082311.3dc76fb1@laptop-sigfox>
<uc4d2e$4ofj$1@solani.org>
<20230823152214.5e86230e@laptop-sigfox>
<yubr0ntht3u.fsf@jpen.ca>
<uc7hb2$3f3vg$1@dont-email.me>
Message-ID: <a8qdndVgG6oR33H5nZ2dnZfqnPWdnZ2d@giganews.com>
Date: Mon, 28 Aug 2023 06:45:32 +0000
Lines: 44
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-ssFfyxh4dv9dzW1Br5ohy1bxLUKwbYE7VL9o7F7c5/u0WVQvf5jlC1OpG9RW2lakUhIXJtCc3PkhNBl!qeGx8H3m32GQ9AbXUc3dQ+Vf00tXgiaSmzdQ31kpoOXEYUCsZNKXN0mZMC8SssqPjJIErzdDPyg=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Michael J. Mahon - Mon, 28 Aug 2023 06:45 UTC

Jeff Blakeney <CUTjeffrey_blakeney@yahoo.ca> wrote:
> On 2023-08-24 2:06 a.m., Jerry Penner wrote:
>> Colin Leroy-Mira <colin@colino.net> writes:
>>
>> The P8 tech-ref states:
>>
>> ---------------------------------------- SYSCALL JSR MLI ;Call
>> Command Dispatcher DB CMDNUM ;This determines which call is being
>> made DW CMDLIST ;A two-byte pointer to the parameter list BNE
>> ERROR ;Error if nonzero
>>
>> Upon completion of the call, the MLI returns to the address of the
>> JSR plus 3 (in the above example, the BNE statement); the call number
>> and parameter list pointer are skipped.
>> ----------------------------------------
>>
>> Where the CPU returns to is 6 bytes past the label SYSCALL, which is
>> the location of the "BNE ERROR" instruction.
>>
>> I think I always read and understood the book the way I think Oliver
>> does, but I think the book's address arithmetic is wrong, looking at
>> it now.
> As far as I remember my 6502 assembly, when you do a JSR, the processor
> has already read the JSR byte and the two byte address so the PC is
> pointing at the DB CMDNUM statement and that is what is pushed on the
> stack. The MLI pulls that address off the stack, adds 3 to it, pushes
> it back on the stack and does an RTS so that the BNE ERROR statement
> will get executed.
>
> In other words, the SYSCALL is the address of the JSR but it isn't the
> address that gets pushed onto the stack when the JSR is executed.

Well, the details are: JSR pushes the address of the JSR opcode plus *two*
on the stack, and the RTS pops the address and adds *one* to get the return
PC value.

This doesn’t change the need to add 3 to the stacked value to skip 3 bytes
of in-line data, but it does mean that the stacked address points at the
high byte of the JSR, not the first byte of the in-lined data.

Sometimes details matter. ;-)

--
-michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com

Re: Typo in ProDOS refTechMan

<uci3t9$1mmm2$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=354&group=comp.sys.apple2.programmer#354

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: CUTjeffr...@yahoo.ca (Jeff Blakeney)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Typo in ProDOS refTechMan
Date: Mon, 28 Aug 2023 08:28:25 -0400
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <uci3t9$1mmm2$1@dont-email.me>
References: <20230822221945.4eb8a091@laptop-sigfox> <yubzg2iicr9.fsf@jpen.ca>
<20230823082311.3dc76fb1@laptop-sigfox> <uc4d2e$4ofj$1@solani.org>
<20230823152214.5e86230e@laptop-sigfox> <yubr0ntht3u.fsf@jpen.ca>
<uc7hb2$3f3vg$1@dont-email.me>
<a8qdndVgG6oR33H5nZ2dnZfqnPWdnZ2d@giganews.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 28 Aug 2023 12:28:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="87230761eaaabf901b04e24dd52e69ef";
logging-data="1792706"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+TeXjvcIAMgC8gs9GAMnrQkF1sTxIusKc="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:j3kZto5iTqpjQISUjI9rbHqv64g=
In-Reply-To: <a8qdndVgG6oR33H5nZ2dnZfqnPWdnZ2d@giganews.com>
Content-Language: en-CA
 by: Jeff Blakeney - Mon, 28 Aug 2023 12:28 UTC

On 2023-08-28 2:45 a.m., Michael J. Mahon wrote:
> Jeff Blakeney <CUTjeffrey_blakeney@yahoo.ca> wrote:
>> As far as I remember my 6502 assembly, when you do a JSR, the processor
>> has already read the JSR byte and the two byte address so the PC is
>> pointing at the DB CMDNUM statement and that is what is pushed on the
>> stack. The MLI pulls that address off the stack, adds 3 to it, pushes
>> it back on the stack and does an RTS so that the BNE ERROR statement
>> will get executed.
>>
>> In other words, the SYSCALL is the address of the JSR but it isn't the
>> address that gets pushed onto the stack when the JSR is executed.
>
> Well, the details are: JSR pushes the address of the JSR opcode plus *two*
> on the stack, and the RTS pops the address and adds *one* to get the return
> PC value.

I haven't done any 6502 coding in a long time but my memory tells me the
6502 did it this way: PC has address of SYSCALL (or probably SYSCALL-1
and increments the PC to get there), processor reads the byte there to
see what opcode to execute, sees it is a JSR so increments the PC and
reads the low byte of the address, increments the PC and reads the high
byte of the address, pushes the current PC (SYSCALL +2) to the stack,
changes the PC to the address it just read and continues execution from
there. When it hits an RTS it pulls the address off the stack, adds one
to it and continues executing from there.

> This doesn’t change the need to add 3 to the stacked value to skip 3 bytes
> of in-line data, but it does mean that the stacked address points at the
> high byte of the JSR, not the first byte of the in-lined data.
>
> Sometimes details matter. ;-)

Breaking it down above, I realized that I probably got it wrong in my
original post and the stack gets the address of the high byte and not
the address of the DB CMDNUM. Also it makes me wonder if the 6502
subtracts one from the JSR address when it puts it in the PC so that it
can be incremented before reading the opcode at the JSR address. It
depends on whether the 6502 always increments the PC before reading the
next opcode and my memory fails me on that point.

As to the original question, the 6502 pushes SYSCALL + 2 to the stack,
the MLI needs to add 3 to the address pulled off the stack, the 6502
adds 1 when it does the RTS so you end up continuing execution at
SYSCALL +6 in the example.

Knowing the details of how the 6502 works in this case isn't really
necessary, you just need to know that your code will continue executing
after the command block. :)

Re: Typo in ProDOS refTechMan

<826490d5-08a0-4f9f-913f-c632f0503492n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=355&group=comp.sys.apple2.programmer#355

  copy link   Newsgroups: comp.sys.apple2.programmer
X-Received: by 2002:a05:620a:a52:b0:76d:71f7:2692 with SMTP id j18-20020a05620a0a5200b0076d71f72692mr802889qka.11.1693243390034;
Mon, 28 Aug 2023 10:23:10 -0700 (PDT)
X-Received: by 2002:a81:ad4f:0:b0:58c:9db5:82e5 with SMTP id
l15-20020a81ad4f000000b0058c9db582e5mr838784ywk.3.1693243389686; Mon, 28 Aug
2023 10:23:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.apple2.programmer
Date: Mon, 28 Aug 2023 10:23:09 -0700 (PDT)
In-Reply-To: <20230822221945.4eb8a091@laptop-sigfox>
Injection-Info: google-groups.googlegroups.com; posting-host=47.154.18.225; posting-account=bGpciwoAAACg2KT8pQMph7tnt3o_9vtu
NNTP-Posting-Host: 47.154.18.225
References: <20230822221945.4eb8a091@laptop-sigfox>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <826490d5-08a0-4f9f-913f-c632f0503492n@googlegroups.com>
Subject: Re: Typo in ProDOS refTechMan
From: peter.fe...@gmail.com (qkumba)
Injection-Date: Mon, 28 Aug 2023 17:23:10 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1256
 by: qkumba - Mon, 28 Aug 2023 17:23 UTC

> In fact, "Upon completion of the call, the MLI returns to the address
> of the JSR plus 6" - not 3.

It should say to the *return address* of the JSR plus 3.

Re: Typo in ProDOS refTechMan

<86fc3cca-8500-4cd6-9834-c4d347772ad8n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=356&group=comp.sys.apple2.programmer#356

  copy link   Newsgroups: comp.sys.apple2.programmer
X-Received: by 2002:a05:620a:2196:b0:76e:f2b8:1803 with SMTP id g22-20020a05620a219600b0076ef2b81803mr544666qka.6.1693250977056;
Mon, 28 Aug 2023 12:29:37 -0700 (PDT)
X-Received: by 2002:a63:8f50:0:b0:56c:6b2:95bc with SMTP id
r16-20020a638f50000000b0056c06b295bcmr4152654pgn.6.1693250976755; Mon, 28 Aug
2023 12:29:36 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.apple2.programmer
Date: Mon, 28 Aug 2023 12:29:36 -0700 (PDT)
In-Reply-To: <826490d5-08a0-4f9f-913f-c632f0503492n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=82.124.249.155; posting-account=c4quJwoAAABUj_DOmUN3HIuXxN1tF7gT
NNTP-Posting-Host: 82.124.249.155
References: <20230822221945.4eb8a091@laptop-sigfox> <826490d5-08a0-4f9f-913f-c632f0503492n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <86fc3cca-8500-4cd6-9834-c4d347772ad8n@googlegroups.com>
Subject: Re: Typo in ProDOS refTechMan
From: ntn.vig...@gmail.com (Antoine Vignau)
Injection-Date: Mon, 28 Aug 2023 19:29:37 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1568
 by: Antoine Vignau - Mon, 28 Aug 2023 19:29 UTC

On Monday, August 28, 2023 at 7:23:10 PM UTC+2, qkumba wrote:
> > In fact, "Upon completion of the call, the MLI returns to the address
> > of the JSR plus 6" - not 3.
> It should say to the *return address* of the JSR plus 3.

EXACTLY! That is the only viable/correct/reliable/<insert positive adjective>/ sentence.

Antoine

Re: Typo in ProDOS refTechMan

<q3e5sj-8q1.ln1@hendrix.foo>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=357&group=comp.sys.apple2.programmer#357

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: phayw...@alphalink.com.au (Peter 'Shaggy' Haywood)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Typo in ProDOS refTechMan
Date: Thu, 31 Aug 2023 13:30:34 +1000
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <q3e5sj-8q1.ln1@hendrix.foo>
References: <20230822221945.4eb8a091@laptop-sigfox> <yubzg2iicr9.fsf@jpen.ca> <20230823082311.3dc76fb1@laptop-sigfox> <uc4d2e$4ofj$1@solani.org> <20230823152214.5e86230e@laptop-sigfox> <yubr0ntht3u.fsf@jpen.ca> <uc7hb2$3f3vg$1@dont-email.me> <a8qdndVgG6oR33H5nZ2dnZfqnPWdnZ2d@giganews.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8Bit
Injection-Info: dont-email.me; posting-host="bf00c0b86fabb293a882336e26d66c6a";
logging-data="3499296"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/RVXEXRuNdkg4VNnvP85PsVDa5e4EdRS0="
User-Agent: KNode/0.10.9
Cancel-Lock: sha1:r2wyTBY/i3OGtWM7pPV/rZ7tP+0=
 by: Peter 'Shaggy&# - Thu, 31 Aug 2023 03:30 UTC

Groovy hepcat Michael J. Mahon was jivin' in comp.sys.apple2.programmer
on Mon, 28 Aug 2023 04:45 pm. It's a cool scene! Dig it.

> Jeff Blakeney <CUTjeffrey_blakeney@yahoo.ca> wrote:
>
>> In other words, the SYSCALL is the address of the JSR but it isn't
>> the address that gets pushed onto the stack when the JSR is executed.
>
> Well, the details are: JSR pushes the address of the JSR opcode plus
> *two* on the stack, and the RTS pops the address and adds *one* to get
> the return PC value.

Not quite. What happens is that the first byte of the instruction (the
op code) is read and, depending on the particular code, either 0, 1 or
2 operand bytes are read in. In the case of a JSR, 3 bytes are read in
total, the op code and a 2 byte address operand. The program counter is
updated as each byte is read in.
Next, the operation is carried out. For JSR that means the current
value of the PC, which now contains the address of the next instruction
(or whatever occupies the memory following the JSR, including operand)
is pushed on the stack before execution branches to the new location.
An RTS instruction just pulls the address off the stack and bungs it
into the PC so that execution can take up from there.

> This doesn’t change the need to add 3 to the stacked value to skip 3
> bytes of in-line data, but it does mean that the stacked address
> points at the high byte of the JSR, not the first byte of the in-lined
> data.

No, it is the address of the next instruction. You're right about not
changing the need to add 3 to the address. It's just that the address
is that of the following op code..., which before 3 is added, in this
case, isn't an op code but data.

--

----- Dig the NEW and IMPROVED news sig!! -----

-------------- Shaggy was here! ---------------
Ain't I'm a dawg!!

Re: Typo in ProDOS refTechMan

<Yr-cnTfS6NJWfG35nZ2dnZfqnPGdnZ2d@giganews.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=358&group=comp.sys.apple2.programmer#358

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 31 Aug 2023 18:54:03 +0000
User-Agent: NewsTap/5.5 (iPhone/iPod Touch)
Cancel-Lock: sha1:O309nFECNS/s0WOhB/SdHgufosY=
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Typo in ProDOS refTechMan
Content-Type: text/plain; charset=UTF-8
Mime-Version: 1.0
Content-Transfer-Encoding: 8bit
From: mjma...@aol.com (Michael J. Mahon)
References: <20230822221945.4eb8a091@laptop-sigfox>
<yubzg2iicr9.fsf@jpen.ca>
<20230823082311.3dc76fb1@laptop-sigfox>
<uc4d2e$4ofj$1@solani.org>
<20230823152214.5e86230e@laptop-sigfox>
<yubr0ntht3u.fsf@jpen.ca>
<uc7hb2$3f3vg$1@dont-email.me>
<a8qdndVgG6oR33H5nZ2dnZfqnPWdnZ2d@giganews.com>
<uci3t9$1mmm2$1@dont-email.me>
Message-ID: <Yr-cnTfS6NJWfG35nZ2dnZfqnPGdnZ2d@giganews.com>
Date: Thu, 31 Aug 2023 18:54:03 +0000
Lines: 63
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-siy7Y4+8Yn7ioLxWY0XUxxHEzDqu/QzkhHqETQaOYE6lNTKL+yrAQh4Wlst7UFzJCG9PUVE8lb/KY2h!+9HRa4FJeanQwojCibyl1lUrMu1Et8mN1jU9pI35+e888NBLK/6ACEBPH0eA0Czien4BQnDS/lA=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Michael J. Mahon - Thu, 31 Aug 2023 18:54 UTC

Jeff Blakeney <CUTjeffrey_blakeney@yahoo.ca> wrote:
> On 2023-08-28 2:45 a.m., Michael J. Mahon wrote:
>> Jeff Blakeney <CUTjeffrey_blakeney@yahoo.ca> wrote:
>>> As far as I remember my 6502 assembly, when you do a JSR, the processor
>>> has already read the JSR byte and the two byte address so the PC is
>>> pointing at the DB CMDNUM statement and that is what is pushed on the
>>> stack. The MLI pulls that address off the stack, adds 3 to it, pushes
>>> it back on the stack and does an RTS so that the BNE ERROR statement
>>> will get executed.
>>>
>>> In other words, the SYSCALL is the address of the JSR but it isn't the
>>> address that gets pushed onto the stack when the JSR is executed.
>>
>> Well, the details are: JSR pushes the address of the JSR opcode plus *two*
>> on the stack, and the RTS pops the address and adds *one* to get the return
>> PC value.
>
> I haven't done any 6502 coding in a long time but my memory tells me the
> 6502 did it this way: PC has address of SYSCALL (or probably SYSCALL-1
> and increments the PC to get there), processor reads the byte there to
> see what opcode to execute, sees it is a JSR so increments the PC and
> reads the low byte of the address, increments the PC and reads the high
> byte of the address, pushes the current PC (SYSCALL +2) to the stack,
> changes the PC to the address it just read and continues execution from
> there. When it hits an RTS it pulls the address off the stack, adds one
> to it and continues executing from there.
>
>> This doesn’t change the need to add 3 to the stacked value to skip 3 bytes
>> of in-line data, but it does mean that the stacked address points at the
>> high byte of the JSR, not the first byte of the in-lined data.
>>
>> Sometimes details matter. ;-)
>
> Breaking it down above, I realized that I probably got it wrong in my
> original post and the stack gets the address of the high byte and not
> the address of the DB CMDNUM. Also it makes me wonder if the 6502
> subtracts one from the JSR address when it puts it in the PC so that it
> can be incremented before reading the opcode at the JSR address. It
> depends on whether the 6502 always increments the PC before reading the
> next opcode and my memory fails me on that point.

It doesn’t. Note that all the hardware vectors—IRQ, RESET, etc. are the
actual service routine addresses, not the addresses minus one.

This is in contrast with the ROM convention of “RTSing” to a routine whose
address is part of a table of “routine addresses -1” to work around the
lack of an indexed indirect JMP. (RTS takes its time to increment the
return as it pops successive bytes from the stack.)

> As to the original question, the 6502 pushes SYSCALL + 2 to the stack,
> the MLI needs to add 3 to the address pulled off the stack, the 6502
> adds 1 when it does the RTS so you end up continuing execution at
> SYSCALL +6 in the example.
>
> Knowing the details of how the 6502 works in this case isn't really
> necessary, you just need to know that your code will continue executing
> after the command block. :)

Right, but it matters a great deal to the implementor of SYSCALL, or any
other subroutine which uses in-line parameters. ;-)

--
-michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com

Re: Typo in ProDOS refTechMan

<Yr-cnTbS6NJRfG35nZ2dnZfqnPEAAAAA@giganews.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=359&group=comp.sys.apple2.programmer#359

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 31 Aug 2023 18:54:03 +0000
User-Agent: NewsTap/5.5 (iPhone/iPod Touch)
Cancel-Lock: sha1:O309nFECNS/s0WOhB/SdHgufosY=
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Typo in ProDOS refTechMan
Content-Type: text/plain; charset=UTF-8
Mime-Version: 1.0
Content-Transfer-Encoding: 8bit
From: mjma...@aol.com (Michael J. Mahon)
References: <20230822221945.4eb8a091@laptop-sigfox>
<yubzg2iicr9.fsf@jpen.ca>
<20230823082311.3dc76fb1@laptop-sigfox>
<uc4d2e$4ofj$1@solani.org>
<20230823152214.5e86230e@laptop-sigfox>
<yubr0ntht3u.fsf@jpen.ca>
<uc7hb2$3f3vg$1@dont-email.me>
<a8qdndVgG6oR33H5nZ2dnZfqnPWdnZ2d@giganews.com>
<q3e5sj-8q1.ln1@hendrix.foo>
Message-ID: <Yr-cnTbS6NJRfG35nZ2dnZfqnPEAAAAA@giganews.com>
Date: Thu, 31 Aug 2023 18:54:04 +0000
Lines: 45
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-kMIX/41chrH3pkrCkukVObj8X1dhUKDPZXmfmXpC2ftR18JUlyQ6+cIqYQaNVI3DqHe0a7P1leMLx3b!YJuM60wwajQFHIA7eP2P57LfIfiVr+1fktDMDUaWgobRXe/K2G9VJo2fXOovZ0BOMUX4za8cX1o=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Michael J. Mahon - Thu, 31 Aug 2023 18:54 UTC

Peter 'Shaggy' Haywood <phaywood@alphalink.com.au> wrote:
> Groovy hepcat Michael J. Mahon was jivin' in comp.sys.apple2.programmer
> on Mon, 28 Aug 2023 04:45 pm. It's a cool scene! Dig it.
>
>> Jeff Blakeney <CUTjeffrey_blakeney@yahoo.ca> wrote:
>>
>>> In other words, the SYSCALL is the address of the JSR but it isn't
>>> the address that gets pushed onto the stack when the JSR is executed.
>>
>> Well, the details are: JSR pushes the address of the JSR opcode plus
>> *two* on the stack, and the RTS pops the address and adds *one* to get
>> the return PC value.
>
> Not quite. What happens is that the first byte of the instruction (the
> op code) is read and, depending on the particular code, either 0, 1 or
> 2 operand bytes are read in. In the case of a JSR, 3 bytes are read in
> total, the op code and a 2 byte address operand. The program counter is
> updated as each byte is read in.
> Next, the operation is carried out. For JSR that means the current
> value of the PC, which now contains the address of the next instruction
> (or whatever occupies the memory following the JSR, including operand)
> is pushed on the stack before execution branches to the new location.
> An RTS instruction just pulls the address off the stack and bungs it
> into the PC so that execution can take up from there.
>
>> This doesn’t change the need to add 3 to the stacked value to skip 3
>> bytes of in-line data, but it does mean that the stacked address
>> points at the high byte of the JSR, not the first byte of the in-lined
>> data.
>
> No, it is the address of the next instruction. You're right about not
> changing the need to add 3 to the address. It's just that the address
> is that of the following op code..., which before 3 is added, in this
> case, isn't an op code but data.
>

Before posting, you should have RTFM. ;-)

That is NOT how JSR/RTS works.

You can “pretend” that it works like that as long as you never use (or
create) the return data that is pushed on the stack.

--
-michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com

Re: Typo in ProDOS refTechMan

<a1da2442-7cb4-4b4e-9835-0c24ba63e79en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=364&group=comp.sys.apple2.programmer#364

  copy link   Newsgroups: comp.sys.apple2.programmer
X-Received: by 2002:a05:620a:618e:b0:767:fe53:3691 with SMTP id or14-20020a05620a618e00b00767fe533691mr79540qkn.3.1694115702783;
Thu, 07 Sep 2023 12:41:42 -0700 (PDT)
X-Received: by 2002:a25:aa73:0:b0:d72:8661:ee25 with SMTP id
s106-20020a25aa73000000b00d728661ee25mr7092ybi.2.1694115702500; Thu, 07 Sep
2023 12:41:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.apple2.programmer
Date: Thu, 7 Sep 2023 12:41:42 -0700 (PDT)
In-Reply-To: <Yr-cnTbS6NJRfG35nZ2dnZfqnPEAAAAA@giganews.com>
Injection-Info: google-groups.googlegroups.com; posting-host=82.124.249.155; posting-account=c4quJwoAAABUj_DOmUN3HIuXxN1tF7gT
NNTP-Posting-Host: 82.124.249.155
References: <20230822221945.4eb8a091@laptop-sigfox> <yubzg2iicr9.fsf@jpen.ca>
<20230823082311.3dc76fb1@laptop-sigfox> <uc4d2e$4ofj$1@solani.org>
<20230823152214.5e86230e@laptop-sigfox> <yubr0ntht3u.fsf@jpen.ca>
<uc7hb2$3f3vg$1@dont-email.me> <a8qdndVgG6oR33H5nZ2dnZfqnPWdnZ2d@giganews.com>
<q3e5sj-8q1.ln1@hendrix.foo> <Yr-cnTbS6NJRfG35nZ2dnZfqnPEAAAAA@giganews.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a1da2442-7cb4-4b4e-9835-0c24ba63e79en@googlegroups.com>
Subject: Re: Typo in ProDOS refTechMan
From: ntn.vig...@gmail.com (Antoine Vignau)
Injection-Date: Thu, 07 Sep 2023 19:41:42 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1624
 by: Antoine Vignau - Thu, 7 Sep 2023 19:41 UTC

I am a big fan of http://www.brutaldeluxe.fr/documentation/cortland/v7%2065SC816%20opcodes%20Cycle%20by%20cycle%20listing.pdf

I let you discover the opcodes, cycle by cycle listing,

Antoine

Re: Typo in ProDOS refTechMan

<ugfisj-ut1.ln1@hendrix.foo>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=365&group=comp.sys.apple2.programmer#365

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: phayw...@alphalink.com.au (Peter 'Shaggy' Haywood)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: Typo in ProDOS refTechMan
Date: Tue, 05 Sep 2023 12:14:22 +1000
Organization: A noiseless patient Spider
Lines: 64
Message-ID: <ugfisj-ut1.ln1@hendrix.foo>
References: <20230822221945.4eb8a091@laptop-sigfox> <yubzg2iicr9.fsf@jpen.ca> <20230823082311.3dc76fb1@laptop-sigfox> <uc4d2e$4ofj$1@solani.org> <20230823152214.5e86230e@laptop-sigfox> <yubr0ntht3u.fsf@jpen.ca> <uc7hb2$3f3vg$1@dont-email.me> <a8qdndVgG6oR33H5nZ2dnZfqnPWdnZ2d@giganews.com> <q3e5sj-8q1.ln1@hendrix.foo> <Yr-cnTbS6NJRfG35nZ2dnZfqnPEAAAAA@giganews.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8Bit
Injection-Info: dont-email.me; posting-host="2f49e4e0522e5d4447a1f6ed100897ba";
logging-data="3669112"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/nFED1DXQplRfYzTnVlES4KrknyOCi2s0="
User-Agent: KNode/0.10.9
Cancel-Lock: sha1:w2GEvP5pK6SvHVe8vB/w89K68mQ=
 by: Peter 'Shaggy&# - Tue, 5 Sep 2023 02:14 UTC

Groovy hepcat Michael J. Mahon was jivin' in comp.sys.apple2.programmer
on Fri, 1 Sep 2023 04:54 am. It's a cool scene! Dig it.

> Peter 'Shaggy' Haywood <phaywood@alphalink.com.au> wrote:
>> Groovy hepcat Michael J. Mahon was jivin' in
>> comp.sys.apple2.programmer on Mon, 28 Aug 2023 04:45 pm. It's a cool
>> scene! Dig it.
>>
>>> Jeff Blakeney <CUTjeffrey_blakeney@yahoo.ca> wrote:
>>>
>>>> In other words, the SYSCALL is the address of the JSR but it isn't
>>>> the address that gets pushed onto the stack when the JSR is
>>>> executed.
>>>
>>> Well, the details are: JSR pushes the address of the JSR opcode plus
>>> *two* on the stack, and the RTS pops the address and adds *one* to
>>> get the return PC value.
>>
>> Not quite. What happens is that the first byte of the instruction
>> (the
>> op code) is read and, depending on the particular code, either 0, 1
>> or 2 operand bytes are read in. In the case of a JSR, 3 bytes are
>> read in total, the op code and a 2 byte address operand. The program
>> counter is updated as each byte is read in.
>> Next, the operation is carried out. For JSR that means the current
>> value of the PC, which now contains the address of the next
>> instruction (or whatever occupies the memory following the JSR,
>> including operand) is pushed on the stack before execution branches
>> to the new location.
>> An RTS instruction just pulls the address off the stack and bungs
>> it
>> into the PC so that execution can take up from there.
>>
>>> This doesn’t change the need to add 3 to the stacked value to skip 3
>>> bytes of in-line data, but it does mean that the stacked address
>>> points at the high byte of the JSR, not the first byte of the
>>> in-lined data.
>>
>> No, it is the address of the next instruction. You're right about
>> not
>> changing the need to add 3 to the address. It's just that the address
>> is that of the following op code..., which before 3 is added, in this
>> case, isn't an op code but data.
>>
>
> Before posting, you should have RTFM. ;-)
>
> That is NOT how JSR/RTS works.
>
> You can “pretend” that it works like that as long as you never use (or
> create) the return data that is pushed on the stack.

After doing some reading, I see that you are quite correct. I bow to
superior knowledge and would like to say, in the words of Maxwell
Smart, "Sorry about that, Chief!"

--

----- Dig the NEW and IMPROVED news sig!! -----

-------------- Shaggy was here! ---------------
Ain't I'm a dawg!!

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor