Declare a function to be called when a custom LCTRL n register is read:
@lctrl(500) Handler(pri, alt)
{
return 42;
}The decorator parameter must be a bare number. The function name doesn't matter. The values of
pri and alt are the values of those registers when LCTRL is invoked. This function must
return a value, which is set to pri.
Declare a function to be called when a custom SCTRL n register is read:
@sctrl(500) Handler(pri, alt)
{
printf("sctrl 500 called");
}The decorator parameter must be a bare number. The function name doesn't matter. The values of
pri and alt are the values of those registers when SCTRL is invoked.
Calling the handlers is done via LCTRL and SCTRL in assembly:
#emit SCTRL 500
#emit LCTRL 500