beautypg.com

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

Page 248: Assembly file referenced c function prototype, E (the, Referenced c, Function prototype

background image

Using the ANSI C-Compiler

UM013037-1212

224

Zilog Developer Studio II – Z8 Encore!
User Manual

Assembly File

globals on

xref _sin

segment far_data

val:dl %3F060A96

; 0.523599

res:dl 0

segment code

_main:

PUSHX _val+3

PUSHX _val+2

PUSHX _val+1

PUSHX _val;

Load the argument, LSB first, MSB last

CALL _sin;

Call the function, the result is in R0, R1, R2, R3

POP R4

POP R4

POP R4

POP R4

; Pop the argument from stack

LDX _res,R0 ; Save the result, MSB from R0, LSB from R3

LDX _res+1,R1

LDX _res+2,R2

LDX _res+3,R3

ret

Referenced C Function Prototype

double sin(double arg);

// double is the same as float on Z8 Encore! C-Compiler

Command Line Options

The compiler, in similar fashion to the other tools in ZDS II, can be run from the command
line for processing inside a script, and so on. See the

Compiler Command Line Options

section on page 484 for the list of compiler commands that are available from the com-
mand line.