kvisc/vm/in/trap.c

28 lines
482 B
C

// The OS/K Team licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#include <in/instrs.h>
static volatile long *prev_stk;
IMPL_START_1(trap)
{
if (v1 > 255)
_except(ctx, E_ILL, "TRAP number greater than 255");
_except(ctx, v1 + 256, "TRAP instruction");
}
IMPL_END;
// XXX more checks
IMPL_START_0(iret)
{
rip = R(CR6);
rfs_current_idx = R(CR7);
ctx->rf = rfs[R(CR7)];
}
IMPL_END;