This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Advantage using software interrupt (SWI)

Hallo

Im just wondering what the advantage is of using software interrupt instead og a function call?

Is the SWI faster? Cant it be disturbed by another interrupt?

/Thomas

Parents
  • One use for SWI instructions is for compiler implementors. In the Armaide Oberon-07 Development system, runtime errors generate SWI instructions. e.g. array indices are checked against array bounds. If the element being accessed is out of range an SWI instruction is generated to call a trap routine which can then return to a suitable recovery point that you have defined in your program.

    All you need to do is add the following procedure call at the location in your application that you want to return to:

    LPC.SetTrapReturn(SYSTEM.FP, SYSTEM.SP, SYSTEM.PC + 0);

Reply
  • One use for SWI instructions is for compiler implementors. In the Armaide Oberon-07 Development system, runtime errors generate SWI instructions. e.g. array indices are checked against array bounds. If the element being accessed is out of range an SWI instruction is generated to call a trap routine which can then return to a suitable recovery point that you have defined in your program.

    All you need to do is add the following procedure call at the location in your application that you want to return to:

    LPC.SetTrapReturn(SYSTEM.FP, SYSTEM.SP, SYSTEM.PC + 0);

Children
No data