National Instruments Corporation GPIB-1014P User Manual page 133

Table of Contents

Advertisement

Appendix C
68000
Code
------------------------------------------------------------------------------------------------------------------------------------------------
CSEND:
clrw
count.L
CSEND1: btst
#CO,ISR2.L
beq
CSEND1
cmpw #count,d0
beq
CSEND3
addw #1,count.L
movb (a0)+,CDOR.L
btst
#ERR,ISR1
bne
CSEND2
add1 #1,a0
bra
CSEND1
CSEND2: movw #-1,d0
CSEND3: rts
© National Instruments Corporation
|
| * * * * * * * * * * * * * * * * * * * * * * * * *
| * COMMAND SEND - CSEND *
| * * * * * * * * * * * * * * * * * * * * * * * * *
|
| Summary:
|
- Called by CMD to send interface command messages
|
| Assumptions on entry:
|
- The GPIB-1014P is Active Controller
|
- The d0 register contains the number of bytes to
|
send
|
- The a0 register contains the address oc cmdbuf
|
| Actions:
|
- Initialize a count variable
|
- Wait until the CDOR is empty
|
- Write a byte and increment the counter
|
- Check for a GPIB error
|
- Loop until all bytes are transferred
|
- On an error, set d0 to -1
|
| Status on return:
|
- d0 register contains number of bytes sent or -1 if an
|
error occurred
|
|
|
Comments
|
| Initialize count variable
|
| Wait till CDOR is empty
|
| Have all commands been sent?
| Yes
| No--Increment counter and write
| the next command
| If there are no Listeners, return -1
| in d0 register
|
|
|
|
C-17
Sample Programs
GPIB-1014P User Manual

Advertisement

Table of Contents
loading

Table of Contents