beautypg.com

Assembly file, Referenced c function prototype, Command line options – Zilog EZ80F916 User Manual

Page 174: Run-time library, Assembly file referenced c function prototype, Command line options run-time library

background image

UM014423-0607

Using the ANSI C-Compiler

ZiLOG Developer Studio II

eZ80Acclaim!

®

User Manual

154

The

sin

function is defined in the C math library.

Assembly File

XREF _sin

segment DATA

_angle:

df 0.523599 ; angle in radians

_res:

; result

ds 4

segment CODE

_myfunc:

...
push DE

; save the live data, if any

ld BC,(_angle)
push BC

; push the argument

ld A,(_angle+3)
ld C,A
push BC
call _sin

; call the C function

pop BC

; restore the stack by popping out the arguments

pop BC
ld (_res),HL ; result is in E:HL registers
ld A,E
ld (_res+3),A
pop DE

; restore the live data

...

Referenced C Function Prototype

double sin (double x);

NOTE: As mentioned in “Double Treated as Float” on page 166, the eZ80 Acclaim!

C-Compiler treats

double

s as if they were

float

s.

COMMAND LINE OPTIONS

The compiler, like the other tools in ZDS II, can be run from the command line for pro-
cessing inside a script, and so on. Please see “Compiler Command Line Options” on
page 383 for the lis
t of compiler commands that are available from the command line.

RUN-TIME LIBRARY

The C-Compiler provides a collection of run-time libraries. The largest section of these
libraries consists of an implementation of much of the C Standard Library. A smaller
library of functions specific to ZiLOG or to the eZ80Acclaim! is also provided.

This manual is related to the following products: