* Copyright (c) 1985 The Regents of the University of California.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)ops.tahoe.c 5.8 (Berkeley) %G%";
typedef unsigned char Opcode
;
#define ACCA (8<<3) /* address only */
#define ACCR (1<<3) /* read */
#define ACCW (2<<3) /* write */
#define ACCM (3<<3) /* modify */
#define ACCB (4<<3) /* branch displacement */
#define ACCI (5<<3) /* XFC code */
#define TYPB 0 /* byte */
#define TYPW 1 /* word */
#define TYPL 2 /* long */
#define TYPQ 3 /* quad */
#define TYPF 4 /* float */
#define TYPD 5 /* double */
#define LITSHORT 0x0 /* short literals */
#define INDEX 0x4 /* i[r] */
#define REGDEF 0x6 /* (r) */
#define AUTODEC 0x7 /* -(r) */
#define AUTOINC 0x8 /* (r)+ */
#define AUTOINCDEF 0x9 /* *(r)+ */
#define BYTEDISP 0xA /* BD(r) */
#define BYTEDISPDEF 0xB /* *BD(r) */
#define WORDDISP 0xC /* WD(r) */
#define WORDDISPDEF 0xD /* *WD(r) */
#define LONGDISP 0xE /* LD(r) */
#define LONGDISPDEF 0xF /* *LD(r) */
#define is_branch_disp(arg) ((arg & ACCB) != 0)
#define typelen(arg) (arg & 07)
#define regnm(mode) (mode & 0xF)
#define addrmode(mode) (mode >> 4)
* Certain opcodes values are used either in calculating
* the next address a process will go to, or for other
* random reasons -- these are defined here.
* Operator information structure.
#define SYSSIZE 151 /* # of system calls */
#define OP(a,b,c,d,e,f,g,h,i) {a,b,c,d,e,f,g,h,i}
public String regname
[] = {
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
"r8", "r9", "r10","r11","r12", "fp", "sp", "pc"
public String systab
[SYSSIZE
] = {
"indir", "exit", "fork", "read",
"write", "open", "close", "owait",
"creat", "link", "unlink", "execv",
"chdir", "otime", "mknod", "chmod",
"chown", "obreak", "ostat", "lseek",
"getpid", "mount", "umount", "osetuid",
"getuid", "ostime", "ptrace", "oalarm",
"ofstat", "opause", "outime", "ostty",
"ogtty", "access", "onice", "oftime",
"sync", "kill", "stat", "osetpgrp",
"lstat", "dup", "pipe", "otimes",
"profil", 0, "osetgid", "getgid",
"ophys", "olock", "ioctl", "reboot",
"ompxchan", "symlink", "readlink", "execve",
"umask", "chroot", "fstat", 0,
"getpagesize", "mremap", "vfork", "ovread",
"ovwrite", "sbrk", "sstk", "mmap",
"ovadvise", "munmap", "mprotect", "madvise",
"vhangup", "ovlimit", "mincore", "getgroups",
"setgroups", "getpgrp", "setpgrp", "setitimer",
"wait", "swapon", "getitimer", "gethostname",
"sethostname", "getdtablesize","dup2", "getdopt",
"fcntl", "select", "setdopt", "fsync",
"setpriority", "socket", "connect", "accept",
"getpriority", "send", "recv", "osocketaddr",
"bind", "setsockopt", "listen", "ovtimes",
"sigvec", "sigblock", "sigsetmask", "sigpause",
"sigstack", "recvmsg", "sendmsg", "vtrace",
"gettimeofday", "getrusage", "getsockopt", "resuba",
"readv", "writev", "settimeofday", "fchown",
"fchmod", "recvfrom", "setreuid", "setregid",
"rename", "truncate", "ftruncate", "flock",
0, "sendto", "shutdown", "socketpair",
"mkdir", "rmdir", "utimes", 0,
0, "getpeername", "gethostid", "sethostid",
"getrlimit", "setrlimit", "killpg", 0,
"quota", "qquota", "getsockname",