-
DMA (cont.)
Stat
(Output)
-High Byte
BIT
15 14 13 12
11 10 9 8
WARN 0
0 0 0 0
0 0
Stat fOutput1
-High Byte
BIT
7 6 5 4
3 2 1 0
0 0 0 0
TM0 IOER MDER CSER
WARN
CSEA
MDER
TM0
NOTE: The meaning of the stat%‘s low bits is dependent on
the setting of the WARN bit.
Warning. If this bit is set to 1, the other bits in stat%
indicate that a Warning has occurred. If it is set to 0, the
other bits indicate that an Error has occurred.
The following are Warning indications (WARN=l):
Address Wraparound Error. If CSER=l and WARN=l, an
“address wraparound” has occurred. This condition arises
as a result of hardware limitations within the PC. The DMA
controller within most PCs generates 16 bits of address;
however, a ZO-bit address is required by the PC. Most PCs
generate the four additional address bits with a “page
register,” which is wired to the most significant address
lines. Address wraparound occurs whenever the DMA
controller counts past its maximum count (FFFF rolls over
to OiKlO), because there is no mechanism to “carry” the most
significant bit into the page register.
For example, if the DMA routine were called with the SEG
parameter set to ZOOO, and the OFS parameters set to FFFF,
the DMA controller would be loaded with a count value of
FFFF, and the page register with a 2. The first location
accessed would be absolute address 2FFFF. The DMA
controller would
then increment its address (to O), however
the page register would not change. Thus, the next location
accessed would be 2ooo0, rather than 3DDDD.
Mode Error. If MDER=l and WARN=l, it signifies that an
invalid Mode Selection was made (see the MODE
parameter description). The DMA routine substitutes
Demand Mode (00) and continues.
Timeout Error. If this bit = 1 and WARN=l, it signifies a
Timeout Error. A Timeout Error indicates that the transfer
was not completed during the designated DMA Timeout
Period. It is possible for the timeout period to expire during
a transfer of a large number of bytes to or from a slow
device, even if the transfer occurs correctly.
The following are Errors fWARN=OI:
PROGRAMMING IN BASICA OR GWBASIC
4.7