3 Copyright (C) 2001, 2023 Hans-Peter Nilsson
5 Permission to use, copy, modify, and distribute this software is
6 freely granted, provided that the above copyright notice, this notice
7 and the following disclaimer are preserved with no changes.
9 THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
10 IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15 #include <sys/types.h>
17 #include "sys/syscall.h"
21 /* The return status is passed on at exit from the simulator by all
22 but the oldest versions of Knuth's mmixware simulator. Beware,
23 "TRAP 0,0,0" is the instruction corresponding to (int32_t) 0 and
24 the value 0 in $255 is common enough that a program crash jumping
25 to e.g. uninitialized memory will look like "exit (0)". */
26 __asm__ ("SET $255,%0\n\tTRAP 0,0,0"