home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
a
/
armedit
/
Docs
/
HPC
< prev
next >
Wrap
Text File
|
1997-02-21
|
20KB
|
735 lines
File : HPC
Date : 21-Feb-97
Author : © A.Thoukydides, 1995, 1996, 1997
Description : High-level Procedure Call (HPC) services implemented by the
ARMEdit module.
INTRODUCTION
The ARMEdit module provides a number of HPC services. To allow development to
start before HPC is included in the PC front-end software, and to support
earlier releases of the front-end software, a simplified interface via I/O
ports is also supported.
All of the services in this document use the HPC service identifier &105
which has been allocated by Aleph One.
I/O PORT ACCESS
The following I/O port assignments are currently used:
&2E0 PORT_STATUS Word read
&2E0 PORT_CMD Word write
&2E2 PORT_DATA Byte or word read/write
The following sequence of operations should occur to perform an HPC call:
Read PORT_STATUS. The possible return codes are:
&454D System is available and ready.
&4D45 System is currently busy processing another HPC call, and
cannot currently be used for another call.
Any other code indicates that the service is not available.
Write &0000 to PORT_CMD to start transfer of data.
Write the HPC packet data to PORT_DATA as either bytes or words.
Write &0001 to PORT_CMD to perform the HPC call.
Write &0002 to PORT_CMD to start reading the reply.
Read the HPC reply packet from PORT_DATA as either bytes or words.
Write &0003 to PORT_CMD to reset the HPC system.
The port based HPC packets have the same 16384 byte limit that proper HPC
packets have.
Note that only HPC services provided by the ARMEdit module can be called
using this I/O port system; other services can only be called via the normal
HPC system. However, the HPC identifier is still checked.
HPC CALLS
For details of making HPC calls directly (which is potentially much more
efficient) contact Aleph One, as the information is covered by a Non
Disclosure Agreement.
RETURN CODES
All of the HPC calls place a 4 byte return code at the start of the return
block. The generic values are
&0000 The operation was successful.
&0001 The operation failed. The exact meaning of this depends upon the
reason code, but in general it indicates that the rest of the
return block is invalid.
&FFFF Service or reason code is unknown.
See the individual reason codes for details of any other codes returned, and
any contents of the remainder of the return block.
HPC_ARMEDIT_SWI
Calls a specified RISC OS SWI by number. The SWI is always called with
the X (error returning) bit set.
Data sent:
Offset Size Description
0 2 HPC service ID.
2 2 Reason code = &0000.
4 4 SWI number.
8 40 Values for registers R0 to R9 on entry to the SWI.
Data returned:
Offset Size Description
0 4 Return code.
4 256 RISC OS style error block returned by SWI if the
return code is &0001.
260 40 Values of registers R0 to R9 on exit from the SWI if
the return code is &0000.
HPC_ARMEDIT_READ
Read ARM memory.
Data sent:
Offset Size Description
0 2 HPC service ID.
2 2 Reason code = &0001.
4 4 Start address of memory to read.
8 4 Number of bytes to read. (n <= 16380)
Data returned:
Offset Size Description
0 4 Return code.
4 n The contents of the specified memory.
HPC_ARMEDIT_WRITE
Write ARM memory.
Data sent:
Offset Size Description
0 2 HPC service ID.
2 2 Reason code = &0002.
4 4 Start address of memory to read.
8 4 Number of bytes to write. (n <= 16372)
12 n The data to write.
Data returned:
Offset Size Description
0 4 Return code.
HPC_ARMEDIT_ALLOC
Claim a block of ARM memory. This is automatically released when the PC
is shutdown or reset, but it is better to free it when no longer required
using HPC_ARMEDIT_FREE.
Data sent:
Offset Size Description
0 2 HPC service ID.
2 2 Reason code = &0003.
4 4 Amount of memory to claim.
Data returned:
Offset Size Description
0 4 Return code.
4 4 Address of the block of memory allocated.
HPC_ARMEDIT_FREE
Release a block of ARM memory previously claimed using HPC_ARMEDIT_ALLOC.
Data sent:
Offset Size Description
0 2 HPC service ID.
2 2 Reason code = &0004.
4 4 The address of the block of memory.
Data returned:
Offset Size Description
0 4 Return code.
HPC_ARMEDIT_EXTTYPE
Convert a DOS extension into a RISC OS filetype.
Data sent:
Offset Size Description
0 2 HPC service ID.
2 2 Reason code = &0005.
4 4 The extension in upper case padded with 0 bytes to
four characters.
Data returned:
Offset Size Description
0 4 Return code.
4 4 The RISC OS filetype.
HPC_ARMEDIT_TYPEEXT
Convert a RISC OS filetype into a DOS extension.
Data sent:
Offset Size Description
0 2 HPC service ID.
2 2 Reason code = &0006.
4 4 The RISC OS filetype.
Data returned:
Offset Size Description
0 4 Return code.
4 4 The extension in upper case padded with 0 bytes to
four characters.
HPC_ARMEDIT_FOPEN
Open a RISC OS file. This is automatically closed when the PC is shutdown
or reset, but it is better to close it when no longer required using
HPC_ARMEDIT_CLOSE. A file opened using this call should not be closed
using RISC OS routines directly.
Data sent:
Offset Size Description
0 2 HPC service ID.
2 2 Reason code = &0007.
4 4 -1 to open existing file, or initial size of file to
create a new one.
8 4 Non-zero to automatically delete the file when closed.
12 n Name of file to open.
Data returned:
Offset Size Description
0 4 Return code.
4 4 RISC OS file handle.
HPC_ARMEDIT_FCLOSE
Close a RISC OS file previously opened using HPC_ARMEDIT_OPEN. The file
is deleted if specified when the file was opened.
Data sent:
Offset Size Description
0 2 HPC service ID.
2 2 Reason code = &0008.
4 4 RISC OS file handle.
Data returned:
Offset Size Description
0 4 Return code.
HPC_ARMEDIT_FREAD
Read from a RISC OS file.
Data sent:
Offset Size Description
0 2 HPC service ID.
2 2 Reason code = &0009.
4 4 RISC OS file handle.
8 4 Sequential file pointer for start of block, or -1 for
current position.
12 4 Number of bytes to read.
Data returned:
Offset Size Description
0 4 Return code.
4 4 Number of bytes read.
8 n The data read from the file.