beautypg.com

Appendix a initialization and link files, Initialization file, Appendix a – Zilog Z80380 User Manual

Page 91: Initialization and link files, Nitialization, Ppendix

background image

UM004001-COR1103

A–1

380 C-

COMPILER

U

SER

S

M

ANUAL

A

PPENDIX

A

I

NITIALIZATION

AND

L

INK

F

ILES

;--------------------------------------------------------------

INITIALIZATION FILE

The following is the initialization file that is included with the 380 C-comiler installation.

;***********************************************************************

;*

Z380Boot: C Runtime Startup

;*

Copyright (c) ZiLOG, 1999

;***********************************************************************

;***********************************************************************

.sect

".bss"

; In case no-one else names it

;***********************************************************************

.sect

".startup"

; This should be placed properly

.def

_c_int0

.def

__exit

.ref

_main

.ref

.BSS_BASE,.BSS_LENGTH

.ref

.TOS

.INITBSS .equ 1

; Zero the .bss section ?

;**********************************

; Program entry point

;**********************************

_c_int0:

setc

xm

; Extended Mode (32-bit pointers)

setc

lw

; LongWord Mode(32-bit integers)

ldw.iw

sp,.TOS

; Setup SP

.if

.INITBSS

;------ Initialize the .BSS section to zero