ChipFind - документация

Электронный компонент: UM0144

Скачать:  PDF   ZIP
www.docs.chipfind.ru
background image
STMicrolectronics
ST7 Assembler
Linker
UM0144
User manual
Rev 2
June 2005
background image
BLANK
background image
Rev 2
June 2005
UM0144
3/92
4
UM0144
User Manual
ST7 Assembler Linker
Introduction
Thanks for choosing ST7! This manual describes how to use the ST7 Assembler-Linker to
develop applications for ST7 microcontrollers. The assembly tools described in this book form a
development system that assembles, links and formats your source code.
The ST7 Assembler-Linker includes the following tools:
Assembler (ASM): translates your source code (.ASM) written in assembly language, into
object code (.OBJ) specific to the target machine and an optional listing file (.LST).
Linker (LYN): processes the object files (.OBJ) produced by the assembler, resolves all
cross-references between object files and locates all the modules in memory. The
resulting code is output in an object code file (.COD). In a second pass, the Assembler
uses these files to produce an object code file, map and listing with absolute paths.
Obsend (OBS): translates the object code file to produce the final executable in a default
format (.FIN) or other format that you specify (e.g. ST S-record, Motorola S-record, Intel
Hex...).
LIB (Librarian): The librarian enables you to store frequently used subroutines in one
location for use with any number of ST7 applications.
Figure 1.
Schematic overview of the ST7 assembler toolset
www.st.com
background image
ST7 Assembler Linker
4/92
UM0144
Note:
The utility file asli.bat automatically runs ASM, LYN, and OBSEND one after the other for you. Use this batch file only
if you have only one assembly source file ".ASM".
About the user manuals...
This manual provides information about producing an application executable for ST7 from your
application source code in Assembly language. Here, you will find:
An overview of Assembly language for ST7
Instructions for running the ST7 Assembler-Linker
Descriptions of the Assembler output
For information on related subjects refer to the following documentation:
ST7xxxx Datasheet
full description of your ST7.
ST7 Programming Manual
a complete reference to ST7 Assembly language
Host PC system requirements
This tool has been designed to operate on a PC that meets the following:
One of the following operating systems: Microsoft
Windows
98, 2000, Millennium, NT
or XP
.
Intel
Pentium (or compatible) processor with minimum speed of 133 MHz.
Minimum RAM of 32 MB (64 MB recommended).
60 MB of free hard disk space to install all of the ST7 tools.
Getting assistance
For more information, application notes, FAQs and software updates for all the ST
microcontroller development tools, check out the CD-ROM or our website:
www.st.com/mcu
For assistance on all ST microcontroller subjects, or for help developing applications that use
your microcontroller's MSCI peripheral, refer to the contact list provided in
Product Support
on
page 108. We'll be glad to help you.
background image
ST7 Assembler Linker
UM0144
5/92
Contents
1
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2
ST7 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1
Overview of ST7 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2
General instruction syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3
Short and long addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4
Inherent addressing mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.5
Immediate operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.6
Direct and indirect modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.7
Indexed modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
2.8
Relative mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
2.9
High, low addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
3
ST7 Assembler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2
Source files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3
Assembly source code format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.4
Segmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.5
Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.6
Conditional assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.7
Running the assembler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4
Linker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.1
What the linker does . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.2
Invoking the linker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.3
Command line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.4
Linking in detail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.5
The linker in more detail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5
OBSEND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.1
What OBSEND does for you . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.2
Invoking OBSEND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

Document Outline