Date : Mon, 30 Nov 2009 09:41:29 -0000
From : dl.harper@... (David Harper)
Subject: Tube - I/O processor memory questions
Kevin Bracey wrote:
> Did you read it before making that comment? Unlike all the other OS
> calls, it explicitly says for OSARGS
>
> "Note: the control block always resides in the I/O processor's memory,
> regardless of the existence of a Tube processor."
>
> I'd be intrigued to see how you interpret that as "Note: the control
> block lives in the current processor just like any other OS call, so I
> don't know why we bothered writing this note, to be honest."
It could be said to be both.
With any OS call that requires a control block (such as OSWORD, OSARGS,
OSFILE, etc) you begin with a control block in the memory of your main
processor and then call the MOS - exactly the same whether your main
processor is a co-pro or a single-processor system. So from the user's point
of view, MOS calls on a 6502 co-pro and a stand-alone beeb work in the same
way.
If you have a co-pro, then what happens when you make the MOS call is as
follows: The data is copied to the I/O pro, which sets up its own copy of
the control block (in its own RAM). The I/O MOS is called using the data in
this copy, and possibly modifying it. The data is then copied back to the
control block in the co-pro, and control returned to the user.
In reality, there is thus a control block in both processors, though the
user doesn't need to know about the one in the I/O processor.
Most control blocks can be anywhere in memory, but OSARGS is unique is that
the block needs to be in zero page on the 6502. (Because two registers are
used for control information, there is only one 8-byte register left as a
pointer to the block.) This applies to both processors on a 6502-co-pro
system. You begin with a zero-page control block in the co-pro, it is copied
to a zero-page block in the I/O pro, then back to the one in the co-pro. (If
you use a different co-pro, such as the 80186, then the OSARGS block can be
anywhere in memory, but it still has to be copied to a zero-page block in
the I/O processor.)
David Harper