13.7.2. SYS_OPEN (0x01)

Open a file on the host system. The file path is specified either as relative to the current directory of the host process, or absolutely, using the path conventions of the host operating system.

The ARM debuggers interpret the special path name :tt as meaning the console input stream (for an open-read) or the console output stream (for an open-write). Opening these streams is performed as part of the standard startup code for those applications that reference the C stdio streams.


On entry, r1 contains a pointer to a three word argument block:

word 1

is a pointer to a null-terminated string containing a file or device name.

word 2

is an integer that specifies the file opening mode. Table 13.4 gives the valid values for the integer, and their corresponding ANSI C fopen() mode.

word 3

is an integer that gives the length of the string pointed to by word 1. The length does not include the terminating null character that must be present.

Table 13.4. 

ANSI C fopen moderrbr+r+bwwbw+w+baaba+a+b


On exit, r0 contains:

  • a non-zero handle if the call is successful

  • –1 if the call is not successful.

Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D