Skip to main content

IAR Embedded Workbench for RH850 3.20.x

Call table functions

In this section:

The call table instructions—CALLT and SYSCALL—can be used to call a fixed set of functions.

The linker will automatically assign a vector for each function. You cannot mix automatic vectors and vectors declared explicitly using the #pragma vector directive in the same project.

Callt functions

The number of callt functions is limited to 64. This type of function is intended to be used in roughly the same situations as trap functions.

The advantage over TRAP functions is that a system can contain 64 callt functions, whereas only 32 trap functions can be defined. It is also more efficient to call a callt function.

Each callt function must be associated with a vector ranging from 0 to 63. The __callt keyword and the #pragma vector directive can be used to define callt functions. This example defines a function that doubles its argument:

#pragma vector=15
__callt int twice(int x)
{
  return x + x;
}
Syscall functions

The number of syscall functions is limited to 256. This type of function is intended to be used in roughly the same situations as trap functions.

The advantage over TRAP functions is that a system can contain 256 syscall functions, whereas only 32 trap functions can be defined. It is also more efficient to call a syscall function.

This instruction is dedicated to calling the system service of an operating system.

Each syscall function must be associated with a vector ranging from 0 to 255. The __syscall keyword and the #pragma vector directive can be used to define syscall functions. This example defines a function that doubles its argument:

#pragma vector=15
__syscall int twice(int x)
{
  return x + x;
}