[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: help with DHR plotting
In article <4ar5go$fhs@rock101.genie.net>,
Harold Hislop <harold.h@genie.com> wrote:
> David E said (regarding the NEWVIDEO register):
>
> The other bits in this register MUST be preserved when modifying its
> contents - you will cause an instant crash otherwise.
>
> I just cleaned up around here, which means now I can't find a d*mn thing
> but as I recall the IIgs hardware ref has an error in it regarding
> this register. Specifically it is noted that the register should be
> accessed only with a read-modify-write cycle, and then later on states
> that the register is a write =only= register.
Definitely not. NEWVIDEO ($C029) is readable.
There is at least one other register that is write-only, and the
hardware ref says to use a read/modify/write operation to update it.
This is obviously a contradiction in terms.
One example of this is the SCANINT register ($C032), which is used to
clear pending 1-second and scan line interrupts. The hardware ref
claims that this register should be modified using R/M/W. You must
write a zero into specific bits to clear the interrupts.
Reading this register produces garbage, with random values in the
important bit positions. One way to use this regiser would be to write
"all ones" except for the bit corresponding to the interrupt
to be cleared, or "all zeros" in the reserved bits, and 0/1 as
required for the interrupt clear bits.
A safer solution is probably to assume the manual is right: use
read/modify/write, but ensure the defined bits are set correctly.
Both bits must be set explicitly, or you might accediately clear the
other interrupt.
An example of a rather meaningless set of instructions is the Sound
Control Register ($C03C). This is defined as a write-only register,
but one of the bits is labelled "reserved; do not modify"! :-)
--
David Empson
dempson@actrix.gen.nz
Snail mail: P.O. Box 27-103, Wellington, New Zealand