PsiFS: SWI Calls

PsiFS_Get

PsiFS_Get
(SWI &520C3)
Read a PsiFS option or status value

On entry:R0 =option or status value to read
If the value specified by R0 is a string
R1 =pointer to buffer to contain null terminated string value
R2 =size of buffer

On exit:If the value specified by R0 is numeric
R1 =value of the option
If the value specified by R0 is a string
R2 = number of spare bytes in the buffer including the null terminator, i.e.:
R2 > 0implies there are (R2-1) completely unused bytes in the buffer; so R2=1 implies there are 0 unused bytes in the buffer, and therefore the terminator just fitted
R2 < 1implies there are (1-R2) too many bytes to fit in the buffer, which has consequently not been filled in; so R2=0 implies there is 1 byte too many - the terminator - to fit in the buffer

Interrupts:Interrupt status is undefined
Fast interrupts are enabled

Processor mode:Processor is in SVC mode

Re-entrancy:SWI is not re-entrant

Use: This call reads a PsiFS option or status value. An error may be returned if an attempt is made to read the value of an option that is meaningless for the current mode of operation.

The values that may be read are:
R0TypeOption
&0numericmode of operation
&100stringname of the serial block driver
&101numericserial block driver port number
&102numericserial block driver baud rate
&103stringoptional extra serial block driver options
&104numericautomatic baud rate identification mode
&200numericnumber of bytes of serial data received
&201numericnumber of bytes of serial data transmitted
&1000numericstatus of the remote link
&11xxnumericstatus of the specified remote drive
&12xxstringname of the specified remote drive
&2000numericstatus of the printer mirror
&2001stringname of the printer mirror destination

If a string value is specified this may be used as a two-pass process:

  1. On entry, set R0 to specify the value to read, and R1 and R2 (the pointer to, and the size of, the buffer) to zero. On exit, R2 = -(length of string)
  2. Claim a buffer of the right size (1-R2, not just -R2, as a space is needed for the terminator). On entry, ensure that R0 still specifies the value to read, that R1 is set to point to the buffer, and R2 contains the lenght of the buffer. On exit the buffer should be filled in, and R2 should be 1; but check to make sure.

Related SWIs:PsiFS_Set, PsiFS_Mode

Related vectors:None

PsiFS_Get &0
(SWI &520C3)
Get the mode of operation

On entry:R0 =&0

On exit:R1 =mode of operation

Use: This call reads the current mode of operation. The possible values are:
ValueMeaning
0inactive
1remote link mode
2printer mirror mode

PsiFS_Get &100
(SWI &520C3)
Get the serial block driver name

On entry:R0 =&100
R1 =pointer to buffer to contain null terminated serial block driver name
R2 =size of buffer

On exit:R2 =number of spare bytes in the buffer including the null terminator

Use: This call reads the name of the configured serial block driver.

PsiFS_Get &101
(SWI &520C3)
Get the serial block driver port number

On entry:R0 =&101

On exit:R1 =port number (0 for the first)

Use: This call reads the configured serial block driver port number.

PsiFS_Get &102
(SWI &520C3)
Get the serial block driver baud rate

On entry:R0 =&102

On exit:R1 =baud rate

Use: This call reads the configured serial block driver baud rate. The actual baud rate used may be different if either the requested baud rate is not available or automatic baud rate identification is active.

PsiFS_Get &103
(SWI &520C3)
Get the serial block driver options

On entry:R0 =&103
R1 =pointer to buffer to contain null terminated serial block driver options
R2 =size of buffer

On exit:R2 =number of spare bytes in the buffer including the null terminator

Use: This call reads the optional parameter string of the configured serial block driver.

PsiFS_Get &104
(SWI &520C3)
Get the automatic baud rate identification mode

On entry:R0 =&104

On exit:R1 =automatic baud rate identification (0 disables)

Use: This call reads whether automatic baud rate identification is enabled. Only the remote link is affected; the printer mirror always uses the configured baud rate.

PsiFS_Get &200
(SWI &520C3)
Get the number of bytes of serial data received

On entry:R0 =&200

On exit:R1 =number of bytes of serial data received

Use: This call reads the number of bytes of serial data received since the remote link or printer mirror was last enabled.

PsiFS_Get &201
(SWI &520C3)
Get the number of bytes of serial data transmitted

On entry:R0 =&200

On exit:R1 =number of bytes of serial data trasmitted

Use: This call reads the number of bytes of serial data transmitted since the remote link or printer mirror was last enabled.

PsiFS_Get &1000
(SWI &520C3)
Get the status of the remote link

On entry:R0 =&1000

On exit:R1 =remote link status

Use: This call reads the status of the remote link. The bits of the result have the following meaning:
BitMeaning when set
0remote link active
4connected to a SIBO device
5connected to an EPOC device

PsiFS_Get &11xx
(SWI &520C3)
Get the status of the specified remote drive

On entry:R0 =&1100 + drive

On exit:R1 =remote drive status

Use: This call reads the status of a single remote drive. The bits of the result have the following meaning:
BitMeaning when set
0drive present
8ROM drive

The drive may be specified in one of three ways:

  • a zero based index (0 for drive A, through to 25 for drive Z)
  • the ASCII code of the drive letter in upper case (65 for drive A, through to 90 for drive Z)
  • the ASCII code of the drive letter in lower case (97 for drive A, through to 122 for drive Z)

PsiFS_Get &12xx
(SWI &520C3)
Get the name of the specified remote drive

On entry:R0 =&1200 + drive
R1 =pointer to buffer to contain null terminated drive name
R2 =size of buffer

On exit:R2 =number of spare bytes in the buffer including the null terminator

Use: This call reads the name of a single remote drive.

The drive may be specified in one of three ways:

  • a zero based index (0 for drive A, through to 25 for drive Z)
  • the ASCII code of the drive letter in upper case (65 for drive A, through to 90 for drive Z)
  • the ASCII code of the drive letter in lower case (97 for drive A, through to 122 for drive Z)

PsiFS_Get &2000
(SWI &520C3)
Get the status of the printer mirror

On entry:R0 =&2000

On exit:R1 =printer mirror status

Use: This call reads the status of the printer mirror. The bits of the result have the following meaning:
BitMeaning when set
0printer mirror active

PsiFS_Get &2001
(SWI &520C3)
Get the name of the printer mirror destination

On entry:R0 =&2001
R1 =pointer to buffer to contain null terminated printer mirror destination
R2 =size of buffer

On exit:R2 =number of spare bytes in the buffer including the null terminator

Use: This call reads the name of the printer mirror destination.

[Contents] [Up] Copyright © Alexander Thoukydides, 1998, 1999