From 33b7bac870ab975bff5021be2d02698460e7237d Mon Sep 17 00:00:00 2001 From: ceriel Date: Fri, 11 Nov 1988 19:13:26 +0000 Subject: [PATCH] several fixes --- doc/em/app.codes.nr | 12 ++++ doc/em/assem.nr | 4 +- doc/em/env.nr | 140 ++++++++++++++++++++++---------------------- doc/em/mkdispatch.c | 27 +++++++-- 4 files changed, 105 insertions(+), 78 deletions(-) diff --git a/doc/em/app.codes.nr b/doc/em/app.codes.nr index d9166e97f..342e7362d 100644 --- a/doc/em/app.codes.nr +++ b/doc/em/app.codes.nr @@ -120,18 +120,30 @@ The following suffices exist: no arguments .PT .l 16-bit argument +.PT .L +32-bit argument .PT .u 16-bit unsigned argument .PT .lw 16-bit argument divided by the wordsize +.PT .Lw +32-bit argument divided by the wordsize .PT .p positive 16-bit argument +.PT .P +positive 32-bit argument .PT .pw positive 16-bit argument divided by the wordsize +.PT .Pw +positive 32-bit argument divided by the wordsize .PT .n negative 16-bit argument +.PT .N +negative 32-bit argument .PT .nw negative 16-bit argument divided by the wordsize +.PT .Nw +negative 32-bit argument divided by the wordsize .PT .s shortie with as high order argument byte .PT .w diff --git a/doc/em/assem.nr b/doc/em/assem.nr index 38b46fa69..9926a28f3 100644 --- a/doc/em/assem.nr +++ b/doc/em/assem.nr @@ -462,7 +462,7 @@ Common Table for Neutral State and Arguments .TS tab(:); c c s c -l8 l l8 l. +l4 l l4 l. class:bytes:description :240:b1:Instruction label b1 (Not used for branches) @@ -515,7 +515,7 @@ an byte if the trailing argument is not present. tab(|); l s l l s s -l 2 lw(46) l. +l 2 lw(30) l. Example ASCII|Example compact (LOC = 69, BRA = 18 here): diff --git a/doc/em/env.nr b/doc/em/env.nr index abb55229a..b3c476eb5 100644 --- a/doc/em/env.nr +++ b/doc/em/env.nr @@ -120,77 +120,77 @@ The result name 'e' is reserved for the error code. .N 1 List of monitor calls. .DS B -.ta 2n 8n 16n 32n 48n -number name parameters results function +.ta 4n 13n 29n 52n +nr name parameters results function - 1 Exit status:int Terminate this process - 2 Fork e,flag,pid:int Spawn new process - 3 Read fildes:int;buf:ptr;nbytes:unsp - e:int;rbytes:unsp Read from file - 4 Write fildes:int;buf:ptr;nbytes:unsp - e:int;wbytes:unsp Write on a file - 5 Open string:ptr;flag:int - e,fildes:int Open file for read and/or write - 6 Close fildes:int e:int Close a file - 7 Wait e:int;status,pid:int2 - Wait for child - 8 Creat string:ptr;mode:int - e,fildes:int Create a new file - 9 Link string1,string2:ptr - e:int Link to a file - 10 Unlink string:ptr e:int Remove directory entry - 12 Chdir string:ptr e:int Change default directory - 14 Mknod string:ptr;mode,addr:int2 - e:int Make a special file - 15 Chmod string:ptr;mode:int2 - e:int Change mode of file - 16 Chown string:ptr;owner,group:int2 - e:int Change owner/group of a file - 18 Stat string,statbuf:ptr - e:int Get file status - 19 Lseek fildes:int;off:int4;whence:int - e:int;oldoff:int4 Move read/write pointer - 20 Getpid pid:int2 Get process identification - 21 Mount special,string:ptr;rwflag:int - e:int Mount file system - 22 Umount special:ptr e:int Unmount file system - 23 Setuid userid:int2 e:int Set user ID - 24 Getuid e_uid,r_uid:int2 Get user ID - 25 Stime time:int4 e:int Set time and date - 26 Ptrace request:int;pid:int2;addr:ptr;data:int - e,value:int Process trace - 27 Alarm seconds:uns2 previous:uns2 Schedule signal - 28 Fstat fildes:int;statbuf:ptr - e:int Get file status - 29 Pause Stop until signal - 30 Utime string,timep:ptr - e:int Set file times - 33 Access string:ptr;mode:int - e:int Determine file accessibility - 34 Nice incr:int Set program priority - 35 Ftime bufp:ptr e:int Get date and time - 36 Sync Update filesystem - 37 Kill pid:int2;sig:int - e:int Send signal to a process - 41 Dup fildes,newfildes:int - e,fildes:int Duplicate a file descriptor - 42 Pipe e,w_des,r_des:int - Create a pipe - 43 Times buffer:ptr Get process times - 44 Profil buff:ptr;bufsiz,offset,scale:intp Execution time profile - 46 Setgid gid:int2 e:int Set group ID - 47 Getgid e_gid,r_gid:int Get group ID - 48 Sigtrp trapno,signo:int - e,prevtrap:int See below - 51 Acct file:ptr e:int Turn accounting on or off - 53 Lock flag:int e:int Lock a process - 54 Ioctl fildes,request:int;argp:ptr - e:int Control device - 56 Mpxcall cmd:int;vec:ptr e:int Multiplexed file handling - 59 Exece name,argv,envp:ptr - e:int Execute a file - 60 Umask complmode:int2 oldmask:int2 Set file creation mode mask - 61 Chroot string:ptr e:int Change root directory +1 Exit status:int Terminate this process +2 Fork e,flag,pid:int Spawn new process +3 Read fildes:int;buf:ptr;nbytes:unsp + e:int;rbytes:unsp Read from file +4 Write fildes:int;buf:ptr;nbytes:unsp + e:int;wbytes:unsp Write on a file +5 Open string:ptr;flag:int + e,fildes:int Open file for read and/or write +6 Close fildes:int e:int Close a file +7 Wait e:int;status,pid:int2 + Wait for child +8 Creat string:ptr;mode:int + e,fildes:int Create a new file +9 Link string1,string2:ptr + e:int Link to a file +10 Unlink string:ptr e:int Remove directory entry +12 Chdir string:ptr e:int Change default directory +14 Mknod string:ptr;mode,addr:int2 + e:int Make a special file +15 Chmod string:ptr;mode:int2 + e:int Change mode of file +16 Chown string:ptr;owner,group:int2 + e:int Change owner/group of a file +18 Stat string,statbuf:ptr + e:int Get file status +19 Lseek fildes:int;off:int4;whence:int + e:int;oldoff:int4 Move read/write pointer +20 Getpid pid:int2 Get process identification +21 Mount special,string:ptr;rwflag:int + e:int Mount file system +22 Umount special:ptr e:int Unmount file system +23 Setuid userid:int2 e:int Set user ID +24 Getuid e_uid,r_uid:int2 Get user ID +25 Stime time:int4 e:int Set time and date +26 Ptrace request:int;pid:int2;addr:ptr;data:int + e,value:int Process trace +27 Alarm seconds:uns2 previous:uns2 Schedule signal +28 Fstat fildes:int;statbuf:ptr + e:int Get file status +29 Pause Stop until signal +30 Utime string,timep:ptr + e:int Set file times +33 Access string:ptr;mode:int + e:int Determine file accessibility +34 Nice incr:int Set program priority +35 Ftime bufp:ptr e:int Get date and time +36 Sync Update filesystem +37 Kill pid:int2;sig:int + e:int Send signal to a process +41 Dup fildes,newfildes:int + e,fildes:int Duplicate a file descriptor +42 Pipe e,w_des,r_des:int Create a pipe +43 Times buffer:ptr Get process times +44 Profil buff:ptr;bufsiz,offset,scale:intp + Execution time profile +46 Setgid gid:int2 e:int Set group ID +47 Getgid e_gid,r_gid:int Get group ID +48 Sigtrp trapno,signo:int + e,prevtrap:int See below +51 Acct file:ptr e:int Turn accounting on or off +53 Lock flag:int e:int Lock a process +54 Ioctl fildes,request:int;argp:ptr + e:int Control device +56 Mpxcall cmd:int;vec:ptr e:int Multiplexed file handling +59 Exece name,argv,envp:ptr + e:int Execute a file +60 Umask mask:int2 oldmask:int2 Set file creation mode mask +61 Chroot string:ptr e:int Change root directory .DE 1 Codes 0, 11, 13, 17, 31, 32, 38, 39, 40, 45, 49, 50, 52, 55, 57, 58, 62, and 63 are diff --git a/doc/em/mkdispatch.c b/doc/em/mkdispatch.c index a402a2f92..d604c0b9d 100644 --- a/doc/em/mkdispatch.c +++ b/doc/em/mkdispatch.c @@ -227,15 +227,15 @@ int decflag(str) char *str ; { /* ----------- checking --------------*/ int ecodes[256],codes[256],lcodes[256] ; -char eflags[256], flags[256]; -int elows[256], lows[256]; +char eflags[256], flags[256], lflags[256] ; +int elows[256], lows[256], llows[256]; #define NMNEM (sp_lmnem-sp_fmnem+1) #define MUST 1 #define MAY 2 #define FORB 3 -char negc[NMNEM], zc[NMNEM], posc[NMNEM] ; +char negc[NMNEM], zc[NMNEM], posc[NMNEM], lnegc[NMNEM], lposc[NMNEM] ; checkall() { register i,flag ; @@ -274,9 +274,13 @@ checkall() { else if ( flag&OP_POS ) posc[opc]++ ; break ; - case OP16U : case OP32 : - case OP64 : + if ( flag&OP_NEG ) + lnegc[opc]++ ; + else if ( flag&OP_POS ) + lposc[opc]++ ; + break ; + case OP16U : break ; default : error("Illegal type") ; @@ -345,9 +349,11 @@ chkc(flag,icode,emc,low) { case OP64: if ( lcodes[icode]!=-1 ) { mess("Long opcode %d used by %s and %s", - icode,ename(emc),ename(codes[icode])) ; + icode,ename(emc),ename(lcodes[icode])) ; } lcodes[icode]=emc; + lflags[icode]=flag; + llows[icode]=low; break ; } } @@ -356,6 +362,8 @@ ckop(emc,zf,pf,nf) { if ( zc[emc]>1 ) mess("More then one OPNO for %s",ename(emc)) ; if ( posc[emc]>1 ) mess("More then one OP16(pos) for %s",ename(emc)) ; if ( negc[emc]>1 ) mess("More then one OP16(neg) for %s",ename(emc)) ; + if ( lposc[emc]>1 ) mess("More then one OP32(pos) for %s",ename(emc)) ; + if ( lnegc[emc]>1 ) mess("More then one OP32(neg) for %s",ename(emc)) ; switch(zf) { case MUST: if ( zc[emc]==0 ) mess("No OPNO for %s",ename(emc)) ; @@ -439,6 +447,7 @@ writeout() { while (lcodes[i] != -1) { if (!(i % 8)) printf("\n%d", i); printf("\t%s", ename(lcodes[i])); + prx(lflags[i],llows[i],i); i++; } while (i++ % 8) putchar('\t'); @@ -464,6 +473,12 @@ prx(flg,low,opc) else putchar('l'); if (flg&OPWORD) putchar('w'); break; + case OP32: + if (flg&OP_POS) putchar('P'); + else if (flg&OP_NEG) putchar('N'); + else putchar('L'); + if (flg&OPWORD) putchar('w'); + break; case OPSHORT: if (flg & OPWORD) putchar('w'); else putchar('s'); -- 2.34.1