syscall


System call exception (System Call)

[Syntax]

-

syscall vector

 

The following can be specified as vector:

-

Absolute expression having a value of up to 8 bits

[Function]

This instruction calls the system service of an OS.

(1)

Saves the contents of the return PC (address of the instruction next to the syscall instruction) and PSW to EIPC and EIPSW.

(2)

Stores the exception cause code corresponding to vector in the EIIC register.
The exception cause code is the value of vector plus 8000H.

(3)

Updates the PSW according to the exception causes.

(4)

Generates a 32-bit table entry address by adding the value of the SCBP register and vector that is logically shifted 2 bits to the left and zero-extended to a word length.
If vector is greater than the value specified by the SIZE bit of system register SCCFG; however, vector that is used for the above addition is handled as 0.

(5)

Loads the word of the address generated in (4).

(6)

Generates a 32-bit target address by adding the value of the SCBP register to the data in (5).

(7)

Branches to the target address generated in (6).

[Description]

-

The assembler generates one syscall machine instruction.

[Flag]

CY

---

OV

---

S

---

Z

---

SAT

---

[Caution]

-

If an absolute expression having a value exceeding the range of 0 to 255 is specified as vector, the assembler outputs the following message and continues assembling by using the lower 8 bitsNote of the specified value.

W0550011 : Illegal operand (range error in immediate).

Note

The syscall machine instruction takes an immediate value in the range of 0 to 255 (0x0 to 0xFF)as the operand.

 

-

This instruction is dedicated to calling the system service of an OS. For how to use it in the user program, see the Function Specification of each OS.

-

In the syscall instruction memory read operation executed in order to read the table, memory protection is performed with the supervisor privilege.