s5u1c33000c Epson Electronics America, Inc., s5u1c33000c Datasheet - Page 121

no-image

s5u1c33000c

Manufacturer Part Number
s5u1c33000c
Description
Cmos 32-bit Single Chip Microcomputer S5u1c33000c Manual
Manufacturer
Epson Electronics America, Inc.
Datasheet
8.3 Declaring and Initializing Global Variables
The ANSI library functions reference the global variables listed in Table 8.3.1. Since these variables are not
defined in the library, be sure to declare and initialize them before calling a library function in the C source
program.
Among the global variables referenced by the ANSI library functions, those that are used by each function
(malloc, calloc, realloc, and free) are initialized using the initialization function shown below. This function is
defined in stdlib.h.
For the START_ADDRESS and END_ADDRESS, set the start and end addresses of the memory used,
respectively. These addresses are adjusted to the 4-byte boundaries within the function.
Before actually using this function, refer to lib.c in sample\ansilib\ directory.
The following global variables are initialized. These variables are defined in stdlib.h.
unsigned char *ansi_ucStartAlloc; Pointer to indicate the start address of the heap area
unsigned char *ansi_ucEndAlloc; Pointer to indicate the end address of the heap area
unsigned char *ansi_ucNxtAlcP;
unsigned char *ansi_ucTblPtr;
unsigned long ansi_ulRow;
S5U1C33000C MANUAL
(C COMPILER PACKAGE FOR S1C33 FAMILY) (Ver. 4)

FILE _iob[FOPEN_MAX +1];
File structure data for standard input/output
streams
FILE *stdin;
Pointer to standard input/output file
structure data _iob[0]
FILE *stdout;
Pointer to standard input/output file
structure data _iob[1]
FILE *stderr;
Pointer to standard input/output file
structure data _iob[2]
int errno;
Variable to store error number
unsigned int seed;
Variable to store seed of random number
time_t gm_sec;
Elapsed time of timer function in seconds
from 0:00:00 on January 1, 1970
For an example of a source file that declares and initializes these global variables, refer to lib.c in the
sample\ansilib\ directory.
int ansi_InitMalloc(unsigned long START_ADDRESS, unsigned long END_ADDRESS);
FOPEN_MAX=3,
Defined in stdio.h
Global variable
Table 8.3.1 Global variables required of declaration
Address pointer to indicate the beginning of the next new area mapped
Address pointer to indicate the beginning of the next management area
mapped
Line pointer to indicate the next management area mapped
_iob[N]._flg = _UGETN;
_iob[N]._buf = 0;
_iob[N]._fd = N;
stdin = &_iob[0];
stdout = &_iob[1];
stderr = &_iob[2];
errno = 0;
seed = 1;
gm_sec = -1;
(N=0–2)
_iob[0]: Input data for stdin
_iob[1]: Output data for stdout
_iob[2]: Output data for stderr
Initial setting
EPSON
stdio.h, smcvals.h
fgets, fread, fscanf, getc, getchar, gets, scanf, ungetc,
perror, fprintf, fputs, fwrite, printf, putc, putchar, puts,
vfprintf, vprintf
stdio.h
fgets, fread, fscanf, getc, getchar, gets, scanf, ungetc
stdio.h
fprintf, fputs, fwrite, printf, putc, putchar, puts, vfprintf,
vprintf
stdio.h
fprintf, fputs, fwrite, printf, perror, putc, putchar, puts,
vfprintf, vprintf
errno.h
fopen, freopen, fseek, fsetpos, perror, remove,
rename, tmpfile, tmpnam, fprintf, printf, sprintf, vprintf,
vfprintf, fscanf, scanf, sscanf
atof, atoi, calloc, div, ldiv, malloc, realloc, strtod,
strtol, strtoul
acos, asin, atan2, ceil, cos, cosh, exp, fabs, floor,
fmod, frexp, ldexp, log, log10, modf, pow, sin, sinh,
sqrt, tan
stdlib.h
rand, srand
time.h
time
Related header file/function
CHAPTER 8: ANSI LIBRARY
105

Related parts for s5u1c33000c