F$SSvc

From NitrOS-9
Jump to: navigation, search
Set SVC Adds or replaces a system call
OS9 F$SSvc 103F 32

Entry Conditions

Y address of the system call initialization table

Exit Conditions

None

Error Output

CC carry set on error
B error code, if any

Additional Information

  • Set SVC adds or replaces a system call, which you have written, to NitrOS-9’s user and system mode system call tables.
  • Register Y passes the address of a table, which contains the function codes and offsets, to the corresponding system call handler routines. This table has the following format:
Relative
Address
Use  
$00 Function Code <-- First entry
$01
$02
Offset From Byte 3
To Function Handler
 
$03 Function Code <-- Second entry
$04
$05
Offset From Byte 6
To Function Handler
 
 

More Entries




<-- More entries


  $80 End-of-table mark
  • If the most significant bit of the function code is set, NitrOS-9 updates the system table. If the most significant bit of the function code is not set, NitrOS-9 updates the system and user tables.
  • The function request codes are in the range $29-$34. I/O calls are in the range $80-$90.
  • To use a privileged system call, you must be executing a program that resides in the system map and that executes in the system state.
  • The system call handler routine must process the system call and return from the subroutine with an RTS instruction.
  • The handler routing might alter all CPU registers (except Register SP).
  • Register U passes the address of the register stack to the system call hander as shown in the following diagram:
  Relative
Address
Name
U --> CC      $00 R$CC
A $01 R$A (R$D)
B $02 R$B
DP $03 R$DP
X $04 R$X
Y $06 R$Y
U $08 R$U
PC $0A R$PC

krn