![background image](http://html1.mh-extra.com/html/keithley/pio-12/pio-12_user-manual_3969780027.webp)
The following code sets Bit 3 on Port A to 1 without disturbing the other
bits:
30 A % = I N P ( B A D D R ) ' R e a d p o r t A .
40 O U T B A D D R , ( A % O R 2 ^ 3 ) ' O R b i t 3 a n d w r i t e t o
' P o r t A .
The following code clears bit 7:
30 A % = I N P ( B A D D R ) ' R e a d p o r t A .
'AND t h e i n v e r s e o f b i t 7 ,
' e f f e c t i v e l y m a s k i n g i t
' t o a n O F F s t a t e .
40 O U T B A D D R , ( A % A N D N O T ( 2 - 7 ) )
The following code illustrates the use of the BASIC
WAIT
command to
wait for a particular condition on Port C:
30 W A I T BADDR + 2 , N % , J %
The result of an XOR on the data read at Port BADDR +2 (Port C in this
example) and J% is ANDed with N%. If the result is zero, the program
loops back and reads the port again; otherwise execution continues with
the next line.
Programming Notes
The following subsections discuss some of the factors you should
consider when programming the P10-12.
Interpreted Basic
Programs written using Interpreted BASIC are relatively slow in
executing I/O statements. Compiling these programs usually decreases
the execution time dramatically.
I/O Commands
Most high-level languages include port I/O commands. Fortran, however,
does not have built-in I/O commands. Fortran users will have to resort to
4-6
P
r
o
g
r
a
m
m
i
n
g
Содержание PIO-12
Страница 2: ...P10 12 User s Guide Revision D April 1994 Part Number 64190...
Страница 7: ......
Страница 11: ...I I I I I I I 1...
Страница 29: ...I I...
Страница 37: ...I...
Страница 41: ......