0% found this document useful (0 votes)
19 views11 pages

Appendix A

This document describes default settings for running utility programs from an IDE for developing XDC programs. It provides definitions for running Relocate, Download, Split, a terminal emulator, and Grep utilities. The definitions differ slightly between DOS-based and Windows-based IDEs. Relocate creates a HEX file from an EXE, Download transfers HEX files to the XDC, and Split splits HEX files. Definitions are given as examples for customizing settings to match individual development environments.

Uploaded by

gamelab1964
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views11 pages

Appendix A

This document describes default settings for running utility programs from an IDE for developing XDC programs. It provides definitions for running Relocate, Download, Split, a terminal emulator, and Grep utilities. The definitions differ slightly between DOS-based and Windows-based IDEs. Relocate creates a HEX file from an EXE, Download transfers HEX files to the XDC, and Split splits HEX files. Definitions are given as examples for customizing settings to match individual development environments.

Uploaded by

gamelab1964
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

APPENDIX A – ENVIRONMENT SETUP

General Remarks
This appendix describes the default definitions used to run the XDC utility programs from
the Integrated Development Environment (IDE) of a Borland C++ or Turbo C++ compiler.
The three utility programs provided with the XDC Library are:

•Relocate Creates a HEX file from an EXE file.


•Download Transfers a HEX file from the PC to the XDC.
•Split Splits a HEX file into odd and even files.

Definitions are also given for running three other utility programs that are NOT provided
with the XDC Library. These are:

•Terminal Runs your serial communications program.


•Grep Runs a common multi-file search utility.
•Assembler Runs the Turbo Assembler provided with Borland C++.

The Terminal definition is provided for running the terminal emulation software of your
choice. The utility definition for Windows-based IDEs runs the Windows Terminal
program. The definition for DOS-based IDEs is simply a template for you to edit.

It is very useful to have a serial communications program that runs on your PC. It is
common for XDC programs to use serial communications. Even if your XDC program
does not need serial communications, it can be a useful debugging tool. After
downloading an XDC program for testing, you can run your terminal program to
communicate with your XDC program from your PC.

The Grep and Assembler definitions are retained from the default project definitions of
the Borland C++ compiler.

A-1
Compiler and Environment Settings
In addition to running utility programs, the IDE also reads and writes project files that
keep track of the object files, source files, libraries, and compiler options used to build
your program. The project files provided with the XDC Library contain the compiler and
environment settings necessary to build XDC programs.

Complete descriptions of other default settings used in XDC projects are given in
documentation files provided with the XDC Library. If you wish to modify these settings
or create your own project file from scratch, refer to the following files in the
\XDC700\EXAMPLES directory:

•PROJECTS.DOC
•PRJ_OPT.DOC
•PRJ_BC4.DOC

A-2
IDE Definitions to Run XDC Utilities

The definitions used in XDC projects to run utility programs differ slightly between the
DOS-based and Windows-based compilers. The two environments provide slightly
different sets of macros for creating these definitions. Each definition is given twice.
Once for each environment.

Definitions for DOS-based IDEs


Definitions for running utility programs in DOS-based IDEs are called “transfer
functions”. The definitions are edited from the Options|Transfer menu. They are
executed from the System menu, or by a “hot-key”.

These definitions use the following macros provided by the DOS-based IDE:

$EXENAME gives the complete file name of the executable file


generated by the project (i.e. HELLO.EXE).

$NAME() separates the name from the extension (i.e. HELLO).

One of the shifted functions keys (F1 thru F10) is assigned to each definition.

The Program Title defines the text that appears in the System menu. The tilde
character (~) is used to designate a letter in the program title. This letter appears
highlighted in the System menu and acts as an additional hot key when the System
menu is visible.

Relocate Definitions, DOS IDE

Two definitions are provided to run the Relocate utility. One generates a HEX file for an
XDC700/710 controller. The other for an XDC720 controller. The difference is a single
command line switch. The XDC720 definition includes the /2 switch.

You may prefer to use only a single definition. If so, simply delete one and rename the
other to Relocate for XDC. Then set or delete the /2 switch if you change your target
controller model.

Both definitions include the following switch:

/R Makes the utility write the RELOCATE.TXT file. This file contains a
copy of the screen output from the utility. This file provides a useful
record of the option selections applied for, and the results produce by
the last Relocate operation.

Continued on next page

A-3
Relocate for the XDC700/710:

Program Title
~Relocate for the XDC700/710 <Shft-F7>

Program Path
\XDC700\XDC7HEX.EXE

Command Line
$EXENAME /R

Relocate for the XDC720:

Program Title
Relocate for the XDC7~20 <Shft-F6>

Program Path
\XDC700\XDC7HEX.EXE

Command Line
$EXENAME /2 /R

Download Definition, DOS IDE

The definition provided to run the Download utility assumes use of serial port 1 of your
PC. It also assumes that the HEX file to download is named after your executable file.

Program Title
~Download to XDC <Shft-F8>

Program Path
\XDC700\XDC7RUN.EXE

Command Line
1 $NAME($EXENAME).HEX

Split Definition, DOS IDE

The definition provided to run the Split utility assumes that your HEX file is named after
your executable file. It uses the name as a base for naming the hex files that it creates.
The Split utility modifies the base name by appending the characters EVN and ODD to
the base name. If the base name is longer than five characters, it is partially overwritten
to meet the DOS limit of eight characters in a file name.

Program Title
~Split HEX for the XDC <Shft-F9>

Program Path
\XDC700\WORDBYTE.EXE

Command Line
$NAME($EXENAME).HEX $NAME($EXENAME)

A-4
Terminal Definition, DOS IDE

The Terminal definition provided for DOS-based IDEs is simply a template for you to
edit. Fill in the program path and command line according to the requirements of your
terminal emulation program. For example, if you have the “Crosstalk” program, you
might use a script file named XDC.XTK as your configuration file. A typical program path
would be \XTALK\XTALK.EXE and your command line would be simply “xdc”.

Program Title
~Terminal <Shft-F10>

Program Path
\YOURTERM\YOURTERM.EXE

Command Line
yourterm.cfg

Grep Definition, DOS IDE

The Grep definition provided for DOS-based IDEs is retained from Borland's default
project definitions. Grep is a multi-file search utility that is used to find occurrences of a
specified text string in a group of files. You may need to edit the program path to suit
your PC setup.

In this definition, the first item, “-n+”, and the ending items, “str *.c *.h”, form the default
command line to the Grep utility. The other command line items are Borland macros that
integrate Grep with the IDE. They prompt you with a popup window for editing the
command line before the utility runs. This is your opportunity to change “str” to the string
that you seek. You can also edit “*.c” and “*.h” to specify other files or groups of files.
Other Borland macros in the command line cause the output from Grep to appear in the
IDE Message window.

Grep searches for “str” in each of the specified files. Each occurrence of “str” is
displayed on a separate line in the message window. If you double-click the line or
highlight it and press enter, the IDE moves your cursor to the selected occurrence. If
necessary, it opens the file in an editing window.

Program Title
~Grep <Shft-F2>

Program Path
GREP

Command Line
-n+ $MEM(128) $NOSWAP $PROMPT $CAP
MSG(GREP2MSG)str *.c *.h

Continued on next page

A-5
Definitions for Windows-based IDEs
Definitions for running utility programs in Windows-based IDEs are called “tools”. The
definitions are edited from the Options|Tools menu. The Relocate and Download
utilities are each defined to also execute from the Speed menu of a node in the project
window.

These definitions use the following macros provided by the Windows-based IDE:

$PRJNAME gives the complete file name of the project file (i.e.
HELLO.PRJ).

$NAME() separates the name from the extension (i.e. HELLO).

The Name field defines the text that appears in the Tools window that is accessed via
Options|Tools. This window lists all of the defined tools that can be edited. The
provided name definitions all begin with “XDC” so that they are placed together in this
alphabetical list. Each defined XDC tool is set to appear on the Tools menu. Most of the
standard tools (used for PC programs) are deleted from the Tools menu for XDC
projects.

The Menu Text field defines the text that appears in the Tools menu. The ampersand
character (&) is used to designate a letter in the program title. This letter appears
highlighted in the Tools menu and acts as a hot key when the Tools menu is visible.

The Default For field in the Advanced options window holds the file name extension(s)
for nodes that can be double-clicked with the right mouse button to execute the tool.
Only one tool can be the default tool for any given extension. When you list EXE in the
Default For field of any tool, it is automatically deleted from all other tools.

The "Help Hint" field defines the text that appears in the status line at the bottom of the
IDE window when the tool is highlighted in the Tools menu.

Relocate Definitions, Windows IDE

Two definitions are provided to run the Relocate utility. One generates a HEX file for an
XDC700/710 controller. The other for an XDC720 controller. The difference is a single
command line switch. The XDC720 definition includes the /2 switch.

You may prefer to use only a single definition. If so, simply delete one and rename the
other to Relocate for XDC. Then set or delete the /2 switch if you change your target
controller model.

Both definitions include the following switches:

/4 Indicates a version 4.02 or newer compiler version. This is


appropriate, since the provided project file was created with a Borland
C++ 4.5 IDE. However, if you are using a version 4.0 compiler, you
must delete this switch. (No compiler versions older than 4.0 that run
under Windows are capable of producing XDC programs.)

With the /R switch set, it is not necessary to set the /W switch. If you
need to see the screen messages, you can simply view the
RELOCATE.TXT file.

A-6
The Relocate for XDC700/710 tool is defined as the default tool for EXE files. If you
set this definition in the Relocate for XDC720 tool, it deletes the EXE extension as the
default for any other tool. It is convenient to set this option for the Relocate tool that
matches your target controller. Then you can run this utility with a double-click on the
EXE node in the project window.

Relocate for the XDC700/710:

Name
XDC Relocate for 700/710

Path
\xdc700\xdc7hex.exe

Command Line
$NAME($PRJNAME) /4 /R

Menu Text
&Relocate for XDC700/710

Help Hint
Create a HEX file from an EXE file.

Advanced options:

Tool Type Tool Usage


( ) Simple Transfer [x] Place on Tools Menu
( ) Translator [x] Place on Speed Menu
(*) Viewer [ ] Target Translator

Translator/Viewer Details:

Applies To:
.exe;

Default For:
.exe;

Relocate for the XDC720:

Name
XDC Relocate for 720

Path
\xdc700\xdc7hex.exe

Command Line
$NAME($PRJNAME) /2 /4 /R

Menu Text
Relocate for XDC7&20

Help Hint
Create a HEX file from an EXE file.
Continued on next page

A-7
Advanced options:

Tool Type Tool Usage


( ) Simple Transfer [x] Place on Tools Menu
( ) Translator [x] Place on Speed Menu
(*) Viewer [ ] Target Translator

Translator/Viewer Details:

Applies To:
.exe;

Default For:

Download Definition, Windows IDE

The definition provided to run the Download utility assumes use of serial port 1 of your
PC. It also assumes that the HEX file to download is named after your project file.

The definition includes the /W switch to make the utility pause and wait for a keypress
before it returns control to the IDE. This can be an irritation when things are working
correctly, but if the utility returns quickly, due to an error, it is very difficult to read the
screen output without this switch.

The Download tool is defined as the default tool for HEX files. This provides a
convenient means to run the utility with a double-click on the HEX node in the project
window. This feature is the reason for listing a hex node in the project.

Name
XDC Download

Path
\xdc700\xdc7run.exe

Command Line
1 $NAME($PRJNAME).hex /W

Menu Text
&Download to the XDC

Help Hint
Transmit a HEX file to the XDC.

Advanced options:

Tool Type Tool Usage


( ) Simple Transfer [x] Place on Tools Menu
( ) Translator [x] Place on Speed Menu
(*) Viewer [ ] Target Translator

A-8
Translator/Viewer Details:

Applies To:
.hex;

Default For:
.hex;

Split Definition, Windows IDE

The definition provided to run the Download utility assumes that your HEX file is named
after your project file. It uses the same name as the base name for the hex files that it
creates. The Split utility modifies the base name by appending the character EVN and
ODD to the base name. If the base name is longer than five characters, some are
overwritten to meet the DOS limit of eight characters in a file name.

Name
XDC Split

Path
\xdc700\wordbyte.exe

Command Line
$NAME($PRJNAME).hex $NAME($PRJNAME)

Menu Text
&Split for XDC

Help Hint
Split a HEX file into odd and even files.

Advanced options:

Tool Type Tool Usage


(*) Simple Transfer [x] Place on Tools Menu
( ) Translator [ ] Place on Speed Menu
( ) Viewer [ ] Target Translator

Translator/Viewer Details:

Applies To:

Default For:

Continued on next page

A-9
Terminal Definition, Windows IDE

The Terminal definition provided for Windows-based IDEs runs the Windows Terminal
program. It uses the XDC.TRM configuration file provided in the \XDC700\EXAMPLES
directory. The Path includes an explicit drive letter for the Windows directory. You may
need to edit this to suit your PC setup.

Name
XDC Terminal

Path
\windows\terminal.exe

Command Line
\xdc700\examples\xdc.trm

Menu Text
&Terminal for XDC

Help Hint
Run a serial communications program.

Advanced options:

Tool Type Tool Usage


(*) Simple Transfer [x] Place on Tools Menu
( ) Translator [ ] Place on Speed Menu
( ) Viewer [ ] Target Translator

Translator/Viewer Details:

Applies To:

Default For:

Grep Definition, Windows IDE

The Grep definition provided for Windows-based IDEs is retained from Borland's default
project definitions. Grep is a multi-file search utility that is used to find occurrences of a
specified text string in a group of files. You may need to edit the program path to suit
your PC setup.

In this definition, the first item, “-n+”, and the ending items, “void $SELNODES”, form the
default command line to the Grep utility. The &SELNODES macro limits the search to
files associated with currently selected nodes in your project window. The other
command line items are Borland macros that integrate Grep with the IDE. They prompt
you with a popup window for editing the command line before the utility runs. This is your
opportunity to change “void” to the string that you seek. You can also edit “$SELNODES”
to specify specific files or groups of files (i.e. “*.c”). Other Borland macros in the
command line cause the output from Grep to appear in the IDE Message window.

A-10
Grep searches for “void” in each of the specified files. Each occurrence of “void” is
displayed on a separate line in the message window. If you double-click the line or
highlight it and press enter, the IDE moves your cursor to the selected occurrence. If
necessary, it opens the file in an editing window.

Name
GrepFiles

Path
grep.com

Command Line
-n+ $NOSWAP$CAP MSG(GREP2MSG.DLL)$PROMPT
void $SELNODES

Menu Text
&Grep

Help Hint
Grep currently selected nodes.

Advanced options:

Tool Type Tool Usage


(*) Simple Transfer [x] Place on Tools Menu
( ) Translator [ ] Place on Speed Menu
( ) Viewer [ ] Target Translator

Translator/Viewer Details:

Applies To:

Default For:

A-11

You might also like