Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #6088

Re: Typo in ProDOS refTechMan

From Peter 'Shaggy' Haywood <phaywood@alphalink.com.au>
Newsgroups comp.sys.apple2.programmer
Subject Re: Typo in ProDOS refTechMan
Date 2023-08-31 13:30 +1000
Organization A noiseless patient Spider
Message-ID <q3e5sj-8q1.ln1@hendrix.foo> (permalink)
References (3 earlier) <uc4d2e$4ofj$1@solani.org> <20230823152214.5e86230e@laptop-sigfox> <yubr0ntht3u.fsf@jpen.ca> <uc7hb2$3f3vg$1@dont-email.me> <a8qdndVgG6oR33H5nZ2dnZfqnPWdnZ2d@giganews.com>

Show all headers | View raw


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!!

Back to comp.sys.apple2.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Typo in ProDOS refTechMan Colin Leroy-Mira <colin@colino.net> - 2023-08-22 22:19 +0200
  Re: Typo in ProDOS refTechMan Jerry Penner <jerry+a2@jpen.ca> - 2023-08-22 22:49 -0600
    Re: Typo in ProDOS refTechMan Colin Leroy-Mira <colin@colino.net> - 2023-08-23 08:23 +0200
      Re: Typo in ProDOS refTechMan Oliver Schmidt <ol.sc@web.de> - 2023-08-23 07:38 +0000
        Re: Typo in ProDOS refTechMan Colin Leroy-Mira <colin@colino.net> - 2023-08-23 15:22 +0200
          Re: Typo in ProDOS refTechMan Jerry Penner <jerry+a2@jpen.ca> - 2023-08-24 00:06 -0600
            Re: Typo in ProDOS refTechMan Jeff Blakeney <CUTjeffrey_blakeney@yahoo.ca> - 2023-08-24 08:10 -0400
              Re: Typo in ProDOS refTechMan Michael J. Mahon <mjmahon@aol.com> - 2023-08-28 06:45 +0000
                Re: Typo in ProDOS refTechMan Jeff Blakeney <CUTjeffrey_blakeney@yahoo.ca> - 2023-08-28 08:28 -0400
                Re: Typo in ProDOS refTechMan Michael J. Mahon <mjmahon@aol.com> - 2023-08-31 18:54 +0000
                Re: Typo in ProDOS refTechMan Peter 'Shaggy' Haywood <phaywood@alphalink.com.au> - 2023-08-31 13:30 +1000
                Re: Typo in ProDOS refTechMan Michael J. Mahon <mjmahon@aol.com> - 2023-08-31 18:54 +0000
                Re: Typo in ProDOS refTechMan Antoine Vignau <ntn.vignau@gmail.com> - 2023-09-07 12:41 -0700
                Re: Typo in ProDOS refTechMan Peter 'Shaggy' Haywood <phaywood@alphalink.com.au> - 2023-09-05 12:14 +1000
  Re: Typo in ProDOS refTechMan qkumba <peter.ferrie@gmail.com> - 2023-08-28 10:23 -0700
    Re: Typo in ProDOS refTechMan Antoine Vignau <ntn.vignau@gmail.com> - 2023-08-28 12:29 -0700

csiph-web