
Hitachi Embedded Workshop User Manual
153
2.10
Standard I/O and File I/O Processing
The simulator/debugger enables the standard I/O and file I/O processing listed in table 2.2 to be executed by the
user program. When the I/O processing is executed, the [Simulated I/O] window must be open.
Table 2.2 shows the supported I/O functions. The function codes have 16-bit address, 24-bit address, and 32-bit
address versions. Select the version according to the CPU to be used.
Table 2.2
I/O Functions
No.
Function Code
Function Name
Description
1
H’01 (16-bit address)
H’11 (24-bit address)
H'21 (32-bit address)
GETC
Inputs one byte from the standard input
device
2
H’02 (16-bit address)
H’12 (24-bit address)
H'22 (32-bit address)
PUTC
Outputs one byte to the standard output
device
3
H’03 (16-bit address)
H’13 (24-bit address)
H'23 (32-bit address)
GETS
Inputs one line from the standard input device
4
H’04 (16-bit address)
H’14 (24-bit address)
H'24 (32-bit address)
PUTS
Outputs one line to the standard output device
5
H’05 (16-bit address)
H’15 (24-bit address)
H'25 (32-bit address)
FOPEN
Opens a file
6
H'06
FCLOSE
Closes a file
7
H’07(16-bit address)
H’17 (24-bit address)
H'27 (32-bit address)
FGETC
Inputs one byte from a file
8
H’08 (16-bit address)
H’18 (24-bit address)
H'28 (32-bit address)
FPUTC
Outputs one byte to a file
9
H’09 (16-bit address)
H’19 (24-bit address)
H'29 (32-bit address)
FGETS
Inputs one line from a file
10
H’0A (16-bit address)
H’1A (24-bit address)
H'2A (32-bit address)
FPUTS
Outputs one line to a file
11
H'0B
FEOF
Checks for end of the file
12
H'0C
FSEEK
Moves the file pointer
13
H'0D
FTELL
Returns the current position of the file pointer
For details on I/O functions, refer to section 4.22, Standard I/O and File I/O Processing.