1*3761Sroot #include "defs.h" 2*3761Sroot static char sccsid[] = "@(#)optab.c 4.1 05/14/81"; 3*3761Sroot /* 4*3761Sroot * Argument access types 5*3761Sroot */ 6*3761Sroot #define ACCA (8<<3) /* address only */ 7*3761Sroot #define ACCR (1<<3) /* read */ 8*3761Sroot #define ACCW (2<<3) /* write */ 9*3761Sroot #define ACCM (3<<3) /* modify */ 10*3761Sroot #define ACCB (4<<3) /* branch displacement */ 11*3761Sroot #define ACCI (5<<3) /* XFC code */ 12*3761Sroot 13*3761Sroot /* 14*3761Sroot * Argument data types 15*3761Sroot */ 16*3761Sroot #define TYPB 0 /* byte */ 17*3761Sroot #define TYPW 1 /* word */ 18*3761Sroot #define TYPL 2 /* long */ 19*3761Sroot #define TYPQ 3 /* quad */ 20*3761Sroot #define TYPF 4 /* floating */ 21*3761Sroot #define TYPD 5 /* double floating */ 22*3761Sroot 23*3761Sroot 24*3761Sroot TYPE struct optab *OPTAB; 25*3761Sroot struct optab { 26*3761Sroot char *iname; 27*3761Sroot char val; 28*3761Sroot char nargs; 29*3761Sroot char argtype[6]; 30*3761Sroot } optab[] = { 31*3761Sroot #define OP(a,b,c,d,e,f,g,h,i) {a,b,c,d,e,f,g,h,i} 32*3761Sroot #include "../as/instrs" 33*3761Sroot 0}; 34*3761Sroot 35*3761Sroot #define SYSTAB struct systab 36*3761Sroot SYSTAB { 37*3761Sroot int argc; 38*3761Sroot char *sname; 39*3761Sroot } systab[] = { 40*3761Sroot 1, "indir", 41*3761Sroot 0, "exit", 42*3761Sroot 0, "fork", 43*3761Sroot 2, "read", 44*3761Sroot 2, "write", 45*3761Sroot 2, "open", 46*3761Sroot 0, "close", 47*3761Sroot 0, "wait", 48*3761Sroot 2, "creat", 49*3761Sroot 2, "link", 50*3761Sroot 1, "unlink", 51*3761Sroot 2, "exec", 52*3761Sroot 1, "chdir", 53*3761Sroot 0, "time", 54*3761Sroot 3, "mknod", 55*3761Sroot 2, "chmod", 56*3761Sroot 2, "chown", 57*3761Sroot 1, "break", 58*3761Sroot 2, "stat", 59*3761Sroot 2, "seek", 60*3761Sroot 0, "getpid", 61*3761Sroot 3, "mount", 62*3761Sroot 1, "umount", 63*3761Sroot 0, "setuid", 64*3761Sroot 0, "getuid", 65*3761Sroot 0, "stime", 66*3761Sroot 3, "ptrace", 67*3761Sroot 0, "alarm", 68*3761Sroot 1, "fstat", 69*3761Sroot 0, "pause", 70*3761Sroot 1, "30", 71*3761Sroot 1, "stty", 72*3761Sroot 1, "gtty", 73*3761Sroot 0, "access", 74*3761Sroot 0, "nice", 75*3761Sroot 0, "sleep", 76*3761Sroot 0, "sync", 77*3761Sroot 1, "kill", 78*3761Sroot 0, "csw", 79*3761Sroot 0, "setpgrp", 80*3761Sroot 0, "tell", 81*3761Sroot 0, "dup", 82*3761Sroot 0, "pipe", 83*3761Sroot 1, "times", 84*3761Sroot 4, "profil", 85*3761Sroot 0, "tiu", 86*3761Sroot 0, "setgid", 87*3761Sroot 0, "getgid", 88*3761Sroot 2, "signal", 89*3761Sroot 0, "49", 90*3761Sroot 0, "50", 91*3761Sroot 0, "51", 92*3761Sroot 0, "52", 93*3761Sroot 0, "53", 94*3761Sroot 0, "54", 95*3761Sroot 0, "55", 96*3761Sroot 0, "56", 97*3761Sroot 0, "57", 98*3761Sroot 0, "58", 99*3761Sroot 0, "59", 100*3761Sroot 0, "60", 101*3761Sroot 0, "61", 102*3761Sroot 0, "62", 103*3761Sroot 0, "63", 104*3761Sroot }; 105*3761Sroot 106*3761Sroot STRING regname[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", 107*3761Sroot "r8", "r9", "r10","r11","ap", "fp", "sp", "pc"}; 108*3761Sroot STRING fltimm[] = { 109*3761Sroot "0.5", "0.5625", "0.625", "0.6875", "0.75", "0.8125", "0.875", "0.9375", 110*3761Sroot "1.0", "1.125", "1.25", "1.375", "1.5", "1.625", "1.75", "1.875", 111*3761Sroot "2.0", "2.25", "2.5", "2.75", "3.0", "3.25", "3.5", "3.75", 112*3761Sroot "4.0", "4.5", "5.0", "5.5", "6.0", "6.5", "7.0", "7.5", 113*3761Sroot "8.0", "9.0", "10.0", "11.0", "12.0", "13.0", "14.0", "15.0", 114*3761Sroot "16.0", "18.0", "20.0", "22.0", "24.0", "26.0", "28.0", "30.0", 115*3761Sroot "32.0", "36.0", "40.0", "44.0", "48.0", "52.0", "56.0", "60.0", 116*3761Sroot "64.0", "72.0", "80.0", "88.0", "96.0", "104.0", "112.0", "120.0" 117*3761Sroot }; 118*3761Sroot 119*3761Sroot char *fmtr = {"%r"}; 120*3761Sroot char *fmtR = {"%R"}; 121