@@ -0,0 +1,3 @@
+Action
+cv
+libsys
@@ -0,0 +1,6 @@
+name "Xenix 3.0 8086 systemcall library"
+dir libsys
+end
+name "Xenix 3.0 conversion program from ack.out --> Xenix 3.0 a.out"
+dir cv
@@ -0,0 +1,5 @@
+LIST
+Makefile
+compmodule
+libmon_s.a
+head_em.s
@@ -0,0 +1,88 @@
+exit.c
+cleanup.c
+stty.c
+gtty.c
+dup.c
+dup2.c
+execl.c
+execle.c
+execv.c
+pipe.c
+profil.c
+sdget.c
+stime.c
+time.c
+wait.c
+_exit.s
+_pipe.s
+_profil.s
+_sdget.s
+_stime.s
+_time.s
+_wait.s
+access.s
+acct.s
+alarm.s
+brk.s
+chdir.s
+chmod.s
+chown.s
+chroot.s
+close.s
+creat.s
+creatsem.s
+execve.s
+fcntl.s
+fork.s
+fstat.s
+ftime.s
+getegid.s
+geteuid.s
+getgid.s
+getpgrp.s
+getpid.s
+getppid.s
+getuid.s
+ioctl.s
+kill.s
+link.s
+lock.s
+locking.s
+lseek.s
+mknod.s
+mount.s
+nap.s
+nbwaitsem.s
+nice.s
+open.s
+opensem.s
+pause.s
+ptrace.s
+rdchk.s
+read.s
+sbrk.s
+sdenter.s
+sdfree.s
+sdgetv.s
+sdleave.s
+sdwaitv.s
+setgid.s
+setuid.s
+shutdn.s
+signal.s
+sigsem.s
+stat.s
+sync.s
+sys.s
+times.s
+ulimit.s
+umask.s
+umount.s
+uname.s
+unlink.s
+ustat.s
+utime.s
+waitsem.s
+write.s
+xdup.s
@@ -0,0 +1,27 @@
+# $Header$
+MACH=xenix3.0
+all: libmon_o.a head_em.o
+
+install: all
+ ../../install libmon_o.a tail_mon
+ ../../install head_em.o head_em
+cmp: all
+ -../../compare libmon_o.a tail_mon
+ -../../compare head_em.o head_em
+libmon_o.a: libmon_s.a
+ ASAR=aal ; export ASAR ;\
+ march . libmon_o.a
+head_em.o: head_em.s
+ $(MACH) -O -c head_em.s
+clean:
+ rm -f *.o libmon_o.a
+opr :
+ make pr | opr
+pr:
+ @pr `pwd`/head_em.s
+ @arch pv libmon_s.a | pr -h `pwd`/libmon_s.a
@@ -0,0 +1,10 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define __exit
+.sect .text
+__exit:
+ mov ax,1
+ push bp
+ mov bp,sp
+ mov bx,4(bp)
+ call syscal
+1: jmp 1b
@@ -0,0 +1,13 @@
+.define __pipe
+__pipe:
+ mov ax,42
+ mov dx,bx
+ jae 1f
+ mov (_errno),ax
+ mov ax,-1
+ cwd
+1:
+ ret
+.define __profil
+__profil:
+ mov ax,44
+ mov bx,sp
+ add bx,2
@@ -0,0 +1,22 @@
+.define __sdget
+__sdget:
+ mov ax,3368
+ push si
+ push di
+ mov di,10(bp)
+ mov si,8(bp)
+ mov cx,6(bp)
+ pop di
+ pop si
+ pop bp
@@ -0,0 +1,16 @@
+.define __stime
+__stime:
+ mov ax,25
@@ -0,0 +1,8 @@
+.define __time
+__time:
+ mov ax,13
+.define __wait
+__wait:
+ mov ax,7
+.define _access
+_access:
+ mov ax,33
+ jmp sysal
+.define _acct
+_acct:
+ mov ax,51
@@ -0,0 +1,11 @@
+.define _alarm
+_alarm:
+ mov ax,27
+.define _brk
+_brk:
+ mov ax,17
+.define _chdir
+_chdir:
+ mov ax,12
+.define _chmod
+_chmod:
+ mov ax,15
+.define _chown
+_chown:
+ mov ax,16
+.define _chroot
+_chroot:
+ mov ax,61
@@ -0,0 +1 @@
+_cleanup() { }
+.define _close
+_close:
+ mov ax,6
@@ -0,0 +1,4 @@
+if xenix3.0 -c $1 1>&2
+then echo `basename $1 $2`.o
+else exit 1
+fi
+.define _creat
+_creat:
+ mov ax,8
+.define _creatsem
+_creatsem:
+ mov ax,552
+int
+dup(d)
+{
+ return __xdup(d, 0);
+}
+dup2(oldd, newd)
+ oldd |= 64;
+ return __xdup(oldd, newd);
@@ -0,0 +1,9 @@
+execl(name,args)
+ char *name;
+ int args;
+ extern char **environ;
+ return execve(name,&args,environ);
+execle(name,args)
+ char *args;
+ char **p = &args;
+ while (*p++) ;
+ return execve(name,&args,*p);
+execv(name,args)
+ char **args;
+ return execve(name,args,environ);
@@ -0,0 +1,19 @@
+.define _execve
+_execve:
+ mov ax,59
+exit(n)
+ _cleanup();
+ _exit(n);
+.define _fcntl
+_fcntl:
+ mov ax,62
@@ -0,0 +1,20 @@
+.define _fork, _par_uid
+.sect .bss
+.comm _par_uid, 2
+_fork:
+ mov ax,2
+ jb 1f
+ and bx,bx
+ je 2f
+2:
+ mov (_par_uid),ax
+ xor ax,ax
+.define _fstat
+_fstat:
+ mov ax,28
@@ -0,0 +1,12 @@
+.define _ftime
+_ftime:
+ mov ax,2856
+.define _getegid
+_getegid:
+ mov ax,47
+ xchg bx,ax
+.define _geteuid
+_geteuid:
+ mov ax,24
@@ -0,0 +1,7 @@
+.define _getgid
+_getgid:
+.define _getpgrp
+_getpgrp:
+ push ax
+ mov ax,39
+ pop bx
+.define _getpid
+_getpid:
+ mov ax,20
+.define _getppid
+_getppid:
+.define _getuid
+_getuid:
+gtty(fildes, arg)
+ char *arg;
+ return ioctl(fildes, ('t' << 8) | 8, arg);
@@ -0,0 +1,52 @@
+.define begtext,begdata,begbss
+.define hol0,.reghp,.limhp,.trppc,.ignmask
+.define ERANGE,ESET,EHEAP,ECASE,EILLINS,EIDIVZ,EODDZ
+.extern _end
+ERANGE = 1
+ESET = 2
+EIDIVZ = 6
+EHEAP = 17
+EILLINS = 18
+EODDZ = 19
+ECASE = 20
+begtext:
+ mov cx,(bx)
+ mov ax,cx
+ inc ax
+ shl ax,1
+ add ax,bx
+ push bx
+ push cx
+ xor bp,bp
+ call _m_a_i_n
+ call __exit
+.sect .data
+begdata:
+hol0:
+ .data2 0,0
+argv:
+ .data2 3f
+envp:
+ .data2 0
+3:
+ .asciz "PROGRAM"
+.reghp:
+ .data2 endbss
+.limhp:
+.ignmask:
+.trppc:
+ .sect .bss
+begbss:
+.define _ioctl
+_ioctl:
+ mov ax,54
+.define _kill
+_kill:
+ mov ax,37
+.define _link
+_link:
+ mov ax,9
+.define _lock
+_lock:
+ mov ax,45
@@ -0,0 +1,23 @@
+.define _locking
+_locking:
+ mov ax,296
+ mov dx,ax
@@ -0,0 +1,25 @@
+.define _lseek
+_lseek:
+ mov ax,19
+.define _mknod
+_mknod:
+ mov ax,14
+.define _mount
+_mount:
+ mov ax,21
+.define _nap
+_nap:
+ mov ax,3112
+.define _nbwaitsem
+_nbwaitsem:
+ mov ax,1576
+.define _nice
+_nice:
+ mov ax,34
+.define _open
+_open:
+ mov ax,5
+.define _opensem
+_opensem:
+ mov ax,808
+.define _pause
+_pause:
+ mov ax,29
@@ -0,0 +1,14 @@
+long _pipe();
+pipe(f)
+ int f[2];
+ long x;
+ x = _pipe();
+ if (x == -1) return -1;
+ f[0] = x;
+ f[1] = x >> 16;
+ return 0;
+profil(buff, bufsiz, offset, scale)
+ char *buff;
+ int (*offset)();
+ _profil(buff, bufsiz, offset, scale, 7262);
+.define _ptrace
+_ptrace:
+ mov ax,26
+ mov di,4(bp)
+ mov bx,10(bp)
+ mov (_errno),0
@@ -0,0 +1,15 @@
+.define _rdchk
+_rdchk:
+ mov ax,1832
+.define _read
+_read:
+ mov ax,3
+.define _sbrk
+_sbrk:
+ push ds
+ mov ax,4(bp)
+ push dx
+ call __brkctl
+ add sp,8
+__brkctl:
+ mov ax,4904
+.define _sdenter
+_sdenter:
+ mov ax,3880
+.define _sdfree
+_sdfree:
+ mov ax,3624
+char *
+sdget(path, flags, size, mode)
+ char *path;
+ long size;
+ if ((flags & 2) == 2) {
+ if (size > 0) {
+ extern char *_sdget();
+ if (size >= 0x10000L) {
+ extern int errno;
+ errno = 22;
+ return (char *) -1;
+ }
+ return _sdget(path, flags, (unsigned) size - 1, mode);
+.define _sdgetv
+_sdgetv:
+ mov ax,4392
+.define _sdleave
+_sdleave:
+ mov ax,4136
+.define _sdwaitv
+_sdwaitv:
+ mov ax,4648
+.define _setgid
+_setgid:
+ mov ax,46
+.define _setuid
+_setuid:
+ mov ax,23
+.define _shutdn
+_shutdn:
+ mov ax,40
@@ -0,0 +1,123 @@
+.define _signal
+_signal:
+ cmp bx,20
+ mov ax,bx
+ add bx,bx
+ push table(bx)
+ mov table(bx),cx
+ and cx,cx
+ cmp cx,1
+ lea cx,tbl(bx)
+ mov bx,ax
+ mov ax,48
+ jb 4f
+ and ax,ax
+ je 5f
+ cmp ax,1
+ jne 6f
+5:
+ jmp 7f
+6:
+ xchg ax,bx
+ mov ax,22
+4:
+7:
+ctch:
+ mov ax,2(bp)
+ sub ax,tbl
+ shr ax,1
+ call table(bx)
+ pop dx
+ pop cx
+ pop ax
+ add sp,2
+ pop (retadr)
+ pop (dummy)
+ popf
+ jmp (retadr)
+retadr: .space 2
+dummy: .space 2
+tbl:
+ call ctch
+.align
+table:
+ .space 40
+.define _sigsem
+_sigsem:
+ mov ax,1064
+.define _stat
+_stat:
+ mov ax,18
+stime(p)
+ long *p;
+ return _stime(*p);
+stty(fildes, arg)
+ return ioctl(fildes, ('t' << 8) | 9, arg);
+.define _sync
+_sync:
+ mov ax,36
@@ -0,0 +1,70 @@
+.define syscal, sysal, sysn, sysnl, sysnx, sysc, syse, cerror, _errno
+ .comm _errno, 2
+syscal:
+ int 5
+sysal:
+ jb cerror
+syse:
+cerror:
+sysn:
+sysnl:
+sysnx:
+sysc:
+ cbw
+long _time();
+long
+time(p)
+ long l = _time();
+ if (p) *p = l;
+ return l;
+.define _times
+_times:
+ mov ax,43
+.define _ulimit
+_ulimit:
+ mov ax,63
+.define _umask
+_umask:
+ mov ax,60
+.define _umount
+_umount:
+.define _uname
+_uname:
+ mov ax,57
+.define _unlink
+_unlink:
+ mov ax,10
+.define _ustat
+_ustat:
+ mov ax,569
+.define _utime
+_utime:
+ mov ax,30
+long _wait();
+wait(p)
+ int *p;
+ long l = _wait();
+ if (l == -1) return -1;
+ if (*p) *p = (l >> 16);
+ return (int) l;
+.define _waitsem
+_waitsem:
+ mov ax,1320
+.define _write
+_write:
+ mov ax,4
+.define ___xdup
+___xdup:
+ mov ax,41