© National Instruments Corporation C-1 GPIB-1014 User Manual
Appendix CSample Programs
This appendix contains listings of routines in 68000 assembly language code that implement the
essential elements of these major utility functions:
Initialize the GPIB-1014 interface (INIT).
Initialize the interface functions of the GPIB devices (IFC).
Set or clear the GPIB REN line (REN).
Accept data bytes from a Talker (RCV).
Address Talker and read device-dependent messages (READ).
Send data bytes to Listeners (DSEND).
Address Listener and write device-dependent messages (WRITE).
Send command bytes to Listeners (CSEND).
Write interface messages (CMD).
Pass GPIB control to another device (PASSC).
Assumptions regarding the state of the GPIB-1014 appear at the beginning of each routine and
must be adhered to for proper, error-free operation.
The following characteristics of the code must be considered:
Standard 24-bit DMA memory addressing is used.
The GPIB-1014 base address is FF2000 hex.
Normal (non-extended) GPIB addressing is used.
Timeout on subroutine calls is not implemented.
Register values are not saved on subroutine calls.
Program interrupt is not used; status checking is by register polling.
Constants and variables listed in the User-Specified Constants section of the listings must be
initialized to correct values.
In operands containing expressions, + is used in place of logical OR for convenience. An
arithmetic addition yields the same result in the instances used here.