Sample Programs
Appendix C
GPIB-1014P User Manual
C-10
© National Instruments Corporation
|
68000 Code
| Comments
------------------------------------------------------------------------------------------------------------------------------------------------
|
RCV:
link
a6,-4
|
movl
d1,a6@(-4)
| Save d1
movl
d2,a6@(-8)
| Save d2
movb
#FH,AUXMR.L
| Release any handshake holdoff in progress
tst
b cic.L
| Is GPIB-1014P Controller-In-Charge?
beq RCV1
|
movb #AUXRA+0202,AUXMR.L | Yes--Set HLDE and BIN in AUXRA
bra RCV2
|
RCV1: movb #AUXRA,AUXMR.L
|
No--Clear any HLDE or HLDA in effect
|
RCV2: clr d1
|
Clear byte counter
|
RCV3: movb ISR1.L,d2
| Read status
btst #
END+DI,d2
| Wait for GPIB END or DI
beq RCV3
|
btst #END,d2
|
Look for END
bne RCV5
|
movb
DIR,a0@+
| Read byte
addw #1,d1
|
cmpw d0,d1
| More bytes to read?
bne RCV3
|
Yes--continue
bra RCV6
|
No--exit
RCV5: movb DIR,a0@
| END--read last byte
movw d1,d0
| Record bytes read
RCV6: movb #AUXRA+1,AUXMR.L
|
Send HLDA
movl
a6@(-8),d2
| Restore d2
movl
a6@(-4),d1
| Restore d1
unlk
a6
| Unlink
rts
| Return