Sample Programs
Appendix C
GPIB-1014P User Manual
C-12
© National Instruments Corporation
|
68000 Code
| Comments
------------------------------------------------------------------------------------------------------------------------------------------------
|
READ: movb
cmdbuf.L,cmdbuf.L+2 | Put Untalk and Unlisten commands before
movb
#UNT,cmdbuf.L | Talker address in the buffer
movb
#UNL,cmdbuf.L+1
|
addw
#2,cmdct.L
|
bsr
CMD
| Command routine will address the Talker
movb
#LTN,AUXMR.L | Program GPIB-1014P to be a Listener
movb
#GTS,AUXMR.L
| so it can take control synchronously
| later; then go to standby and drop ATN
movw
#datct,d0
| Take control
| Preset d0 register with byte count
movl
#datbuf,a0
| Preset a0 register with buffer address
bsr
RCV
| Receive routine will read data
movb
TCS,AUXMR.L
|
|
READ1:
btst#NATN,ADSR
| Wait for ATN, indefinitely
bne
READ1
|
|
subw
#1,cmdct
| Prepare to unaddress all Talkers and Listeners
bsr
CMD
| using CMD
|
movb
#LUN,AUXMR.L | Send Local Unlisten command
|
rts
|