beautypg.com

Run time initialization file, Installed files, Invoking the linker – Zilog Z80380 User Manual

Page 54: Using the linker in zds, Able, Inker, Referenced, Files

background image

Invoking the Linker

Linking Files

3–4

UM004001-COR1103

R

UN

T

IME

I

NITIALIZATION

F

ILE

The C run-time initialization file is an assembly program that initializes memory before link-
ing. This assembly program clears the .bss section, sets the pointer, and initializes the proces-
sor mode resister. Once these initializations are complete the program calls main, which is
the C entry point.

I

NSTALLED

FILES

The following linker associated files are installed in the C-Compiler installation directory.

N

OTE

:

Source files for the run-time initialization files are provided in Appendix A, Initialization and

Link Files.

INVOKING THE LINKER

The linker can be invoked either through ZDS or the DOS command line.

U

SING

THE

L

INKER

IN

ZDS

The linker is automatically invoked when performing a build in ZDS. The following steps are
performed when using the linker with ZDS.

1. ZDS calls the linker after compiling and assembling all the files.

2. All the object files and libraries that are include in the project are linked.

3. Error or warning messages that are generated by the linker are displayed in the ZDS output

window.

4. If no errors are encountered the linker produces an executable file in either a COFF or HEX

format. This executable file is placed in the project directory.

T

ABLE

3-1. L

INKER

REFERENCED

FILES

File

Description

z380boot.s

Assembly language source of example C startup module

z380.lnk

Example linker command file for z380

libc.lib

Standard C library for small model.

lhf.lib

Library of runtime helper functions