Sample Programs
Appendix C
GPIB-1014P User Manual
C-14
© National Instruments Corporation
|
68000 Code
| Comments
------------------------------------------------------------------------------------------------------------------------------------------------
|
DSEND:
link
a6,-8
| Link
movl
d1,a6@(-4)
| Save d1
movl
d2,a6@(-8)
| Save d12
movl
d0,d1
| Copy byte count
DSEND1:
movb
ISR1.L,d2
|
btst
#DO=ERR,d2
| Wait for CDOR or ERR
beq
DSEND1
|
btst
#ERR,d2
| Look for error
bne
DSEND3
|
subl
#1,d1
| dec byte counter
bmi
DSEND4
| Have all bytes been sent?
bne
DSEND2
| No–Is this last byte?
cmpb
#0,vseoi.L
| Yes–EOI in use?
beq
DSEND2
| No
movb
#SEOI,AUXMR.L
| Send EOI with last byte
DSEND2:
movb
a0@,CDOR.L
| Next byte
bra
DSEND1
|
movb
#DMAO,IMR2
| Enable DMA to the CDOR
DSEND3:
movl
#-1,d0
| Return (-1) indicating error
DSEND4:
movl
a6@(-8),d2
| Restore d2
movl
a6@(-4),d1
| Restore d1
unlk
a6
| Unlink
rts
| Return