Keil™, An ARM® Company

RealView Compiler User's Guide

SYS_WRITE (0x05)

A.3.22. SYS_WRITE (0x05)

Writes the contents of a buffer to a specified file at the current file position. The file position is specified either:

  • explicitly, by a SYS_SEEK

  • implicitly as one byte beyond the previous SYS_READ or SYS_WRITE request.

The file position is at the start of the file when the file is opened, and is lost when the file is closed.

Perform the file operation as a single action whenever possible. For example, do not split a write of 16KB into four 4KB chunks unless there is no alternative.

Entry

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

word 1

Contains a handle for a file previously opened with SYS_OPEN.

word 2

Points to the memory containing the data to be written.

word 3

Contains the number of bytes to be written from the buffer to the file.

Return

On exit, r0 contains:

  • 0 if the call is successful

  • the number of bytes that are not written, if there is an error.

Copyright © 2007 ARM Limited. All rights reserved.ARM DUI 0375A