beautypg.com

4ć14 – Rockwell Automation 6008-SI IBM PC I/O SCNNR 6008-SI User Manual

Page 41

background image

Chapter 4

Programming Overview

4-14

These notes present a simple way of compiling and linking your
application program with the scanner code. This way may or may not be
the best way for your development. There are many alternatives –
Microsoft’s Programmer’s Workbench, make files, and so on. You should
evaluate the alternatives and decide which way is most productive for you.

Decide which memory model you will use (small, compact, medium, large,
or huge). Please see the discussion of memory models in your compiler
manual. In the command below, replace %%%% with the first letter of the
memory model, in upper case.

Use this command to compile and link your program in one step:

CL /J /A%%%% /W3 yourprogname.c /link 6008si%%%%m

The options we recommend are listed in Table 4.D.

Table 4.D

Options for Compile and Link

Options:

Description:

/J

default 'char' is 'unsigned char'

/A

select memory model

/W3

show warnings at compile time

/link

select scanner library

/Od

turn off optimization

/Zi

set up for CodeView debugging

We recommend against the /Zp option (pack structure members). Our
library routines were compiled without it, and may not be compatible with
code you compile with that option.

For information on selecting or excluding the 8087 or 80287 math
coprocessor, please see the Microsoft manual sections on the /FP options.
Our libraries are compatible with any /FP option because they contain no
floating–point operations.

Example 1: Your program is called APPLIC.C. You have selected the
small (S) memory model. The combined command to compile and link
would be

CL /J /AS /W3 applic.c /link 6008sism

Microsoft C will compile applic.c as applic.obj and link it as applic.exe.

Compiling and Linking the

Microsoft C 5.1 or 6.0 Version