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

no-image

s5u1c33000c

Manufacturer Part Number
s5u1c33000c
Description
Cmos 32-bit Single Chip Microcomputer S5u1c33000c Manual
Manufacturer
Epson Electronics America, Inc.
Datasheet
8.4.2 "write" Function
Contents of write function
Definition of output buffer
Precautions on using simulated I/O
8.4.3 "_exit" Function
Contents of _exit function
S5U1C33000C MANUAL
(C COMPILER PACKAGE FOR S1C33 FAMILY) (Ver. 4)
Format:
Argument:
Functionality:
Returned value: Number of bytes actually written to the output buffer
Library function that calls the write function:
Format:
Buffer content: The size of the output data (1 to max. 64) is stored at the beginning of the buffer
When using the debugger's simulated I/O, define in the write function the global label "WRITE_FLASH"
that is required for the debugger to update the output buffer, and create a function so that data will be output
from the output buffer at that position. (For details about the simulated I/O function, refer to the chapter
where the debugger is discussed.)
Format:
Functionality:
Argument/ Returned value: None
Library function that calls _exit function:
int write(int fd, char *buf, int nbytes);
int fd;
char *buf; Pointer to the buffer that stores output data
int nbytes; Number of transferred bytes
The data stored in the buffer indicated by buf is written as much as indicated by nbytes to
the user-defined output buffer.
If data is written normally, nbytes is returned.
If a write error occurs, a value other than nbytes is returned.
Direct call: fwrite, putc, _doprint (_doprint is printf-series internal function)
Indirect call: fputc, fputs, putchar, puts (calls putcc)
unsigned char WRITE_BUF[65]; (Variable name is arbitrary; size is fixed to 65 bytes)
(WRITE_BUF[0]). 0 denotes EOF.
The output data is stored in WRITE_BUF[1], and the following locations.
void _exit(void);
Performs program terminating processing.
Direct call: abort, exit
File descriptor denoting output
When called from a library function, 1 (stdout) or 2 (stderr) is passed.
printf, fprintf, sprintf, vprintf, vfprintf (calls _doprint)
perror (calls fprintf)
EPSON
CHAPTER 8: ANSI LIBRARY
107

Related parts for s5u1c33000c