Appendix C Sample Programs
© National Instruments Corporation C-13 GPIB-1014 User Manual
|
68000 Code | Comments
--------------------------------------------------------------------------------------------------------------------------------------------
|
READ: movb cmdbuf,cmdbuf+2 | Put Untalk and Unlisten commands before
movb #UNT,cmdbuf | Talker address in the buffer
movb #UNL,cmdbuf+1 |
addw #2,cmdct |
|
bsr CMD | Command routine will address the Talker
|
movb #LTN,AUXMR | Program GPIB-1014 to be a Listener
movb #GTS,AUXMR | so it can take control synchronously
| later; then go to standby and drop ATN
|
movw #datct,d0 | 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 | Take control
|
READ1: btst #NATN,ADSR | Wait for ATN, indefinitely
bne READ1 |
|
subw #1,cmdct | Unaddress all Talkers and Listeners
bsr CMD | using CMD
|
movb #LUN,AUXMR | Send Local Unlisten command
|
rts |