Assembly language library functions (external CALLs) for I/O
operations.
P10-12 Interrupt Channel
BASIC does not directly support writing interrupt routines except through
the use of an assembly language CALL. If you are using the interrupt
channel on the P10-12, you probably have to program in Assembly or C
to write an interrupt handler.
Assembly Language
Assembly language provides a direct programming method, as the
following code illustrates:
MOV D X , BASE_ADDRESS
I N A L , D X
OUT D X , A L
; L o a d D X w i t h p o r t a d d r e s s .
; R e a d a p o r t i n t o A L .
; W r i t e A L o u t t o a p o r t .
Note that the 80286/386 processors cannot reliably execute successive
I/O instructions to the same port address. This is due to recovery time
requirements on the I/O peripheral circuits and is not related to the
PIO-12 design.
Because of this limitation, the use of code similar to the following is not
recommended.
I N A L , D X
;
E
x
a
m
p
l
e
o f p r o b l e m a t i c
; c o d e .
INC A L
OUT D X , A L
The suggested work-around to this limitation is to program a short delay
(using a JMP instruction) between successive I/O instructions. This
technique is illustrated in the following code:
I N A L , D X
INC A L
JMP L A B E L
L A B E L : O U T D X , A L
; R e c o m m e n d e d m e t h o d .
;JMP g e n e r a t e s d e l a y &
; b r e a k s i n s t r u c t i o n q u e u e .
4-7
Summary of Contents for PIO-12
Page 2: ...P10 12 User s Guide Revision D April 1994 Part Number 64190...
Page 7: ......
Page 11: ...I I I I I I I 1...
Page 29: ...I I...
Page 37: ...I...
Page 41: ......