EasyManua.ls Logo

Commodore Amiga A500 - Page 79

Commodore Amiga A500
283 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SEE ALSO
BUGS
SYSTEMJLIBRARIESI
NAME
EXPANSION1
WRITEEX~ANS~ONBYTE
WriteExpansionByte
-
write a byte nybble by nybble.
SYNOPSIS
error
=
WriteExpansionByte( board, offset, byte
)
DO A0 DO D1
FUNCTION
WriteExpansionByte write a byte to a new-style expansion board.
These boards have their writeable data organized as a series of
nyb-
bles in memory. This routine writes two nybbles in a very carefull
manner to work with all types of new expansion boards.
To make certain types of board less expensive, an expansion board's
write registers may be organized as either a byte-wide or nybble-
wide register.
If
it
is nybble-wide then
it
must latch the less signifi-
cant nybble until the more significant nybble is written. This allows
the following algorithm to work with either type of board:
write the low order nybble to bits
D1 5-D1
2
of byte (offset*4)
+
2
write the entire byte to bits
D1
5-D8
of byte (offset*4)
The offset is a byte offset into a ExpansionRom structure. The actual
memory address read will be four times larger. The macros
EROFF-
SET and ECOFFSET are provided to help get these offsets from
C.
INPUTS
board
-
a pointer to the base of a new style expansion board.
offset
-
a logical offset from the configdev base
byte
-
the byte of data to be written to the expansion board.
RESULTS
error
-
the routine will return a zero on success, non-zero if there
was a problem.

Related product manuals