beautypg.com

6 low-level programming – ADLINK ACL-8454/12 User Manual

Page 35

background image

Registers Format

27

3.6 Low-level

Programming

To manipulate the ACL-8454, users may understand how to write a
hardware dependent low-level program. Using either assembly or high-level
language such as BASIC or C language can carry out the low-level
programming. The following gives examples to show how to use
programming language to access an add-on I/O card.

Getting Start
Before programming, the add-on card should be correctly installed. After
installing the card, the users should already understand how much system
(PC) resources are used by this card, such as I/O address, IRQ channels,
and even DMA channel, etc.

The second step is to study the register format and the operation theorem
of the card. Then users can try to write low-level programs to operate it.
Although the high-level program library is available, the low-level
programming can improve the efficiency and perform functions which the
library does not support. The low level programming is not difficult and may
be necessary to understand.

Programming Language
The programming language to be used is dependent on users' familiarity
and the system requirement. No matter what kind of language is used, the
user must understand the syntax of the I/O instructions to access the I/O
card. The following sections introduce the syntax of the often used
programming language. In each section, the write (output) port instruction
and the read (input) port instruction are shown. In the examples, the base
address of the I/O card is assumed as HEX 240 and the port of the register
to be access is BASE+2.

Assembly

To write an output port:
out

240h,value

out

240h,register

To read an input port
in

A,

240h