Keil Logo

SYS_OPEN (0x01)

11.16 SYS_OPEN (0x01)

Opens a file on the host system.

The file path is specified either as relative to the current directory of the host process, or absolute, using the path conventions of the host operating system.
ARM targets 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
A pointer to a null-terminated string containing a file or device name.
word 2
An integer that specifies the file opening mode. The following table gives the valid values for the integer, and their corresponding ISO C fopen() mode.
word 3
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 11-3 Value of mode

mode 0 1 2 3 4 5 6 7 8 9 10 11
ISO C fopen modea r rb r+ r+b w wb w+ w+b a ab a+ a+b


On exit, R0 contains:
  • a nonzero handle if the call is successful
  • –1 if the call is not successful.
The non-ANSI option t is not supported.
Non-ConfidentialPDF file icon PDF versionARM DUI0375H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.