5-6
MIDI Port I/O Programming
Checking the Status
Before writing a command byte or MIDI data to (or reading a data byte or MIDI data
from) the MPU-401 interface, the status port must be checked to see whether the
interface is ready.
Bit 6, the Output Ready bit, indicates whether the interface is ready to receive data. If
it is 1, the interface is busy. Otherwise, the command byte or MIDI data can be sent.
Example code:
mov
dx,wMpuBaseAddx
;MPU-401 base I/O address
inc
dx
;Status port
Busy:
in
al,dx
;Read status port
test
al,40h
;Ready for output?
jnz
Busy
;***
;*** Send command or MIDI data here
Bit 7, the Input Ready bit, indicates whether data is available for reading. If it is 1, no
data is available. Otherwise, there is data to be read.
Example code:
mov
dx,wMpuBaseAddx
;MPU-401 base I/O address
inc
dx
;Status port
Busy:
in
al,dx
;Read status port
test
al,80h
;Input data available?
jnz
Busy
;***
;*** Read data here
Содержание SB0350
Страница 29: ......
Страница 71: ...Mixer Chip Programming 4 13 Figure 4 4 Logical Schematic of the Output Mixing Paths ...
Страница 72: ...4 14 Mixer Chip Programming Figure 4 5 Logical Schematic of the Input Mixing Paths ...
Страница 141: ...Index3 ...