*** empty log message ***
This commit is contained in:
parent
d16efbab98
commit
c235c1a93d
8
lang/cem/libcc/mon/_exit.e
Normal file
8
lang/cem/libcc/mon/_exit.e
Normal file
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $_exit
|
||||
pro $_exit,0
|
||||
lol 0
|
||||
loc 1
|
||||
mon
|
||||
end
|
16
lang/cem/libcc/mon/access.e
Normal file
16
lang/cem/libcc/mon/access.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $access
|
||||
pro $access,0
|
||||
lal 0
|
||||
loi EM_WSIZE+EM_PSIZE
|
||||
loc 33
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
16
lang/cem/libcc/mon/acct.e
Normal file
16
lang/cem/libcc/mon/acct.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $acct
|
||||
pro $acct,0
|
||||
lal 0
|
||||
loi EM_PSIZE
|
||||
loc 51
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
9
lang/cem/libcc/mon/alarm.e
Normal file
9
lang/cem/libcc/mon/alarm.e
Normal file
|
@ -0,0 +1,9 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $alarm
|
||||
pro $alarm,0
|
||||
lol 0
|
||||
loc 27
|
||||
mon
|
||||
ret EM_WSIZE
|
||||
end
|
10
lang/cem/libcc/mon/brk.e
Normal file
10
lang/cem/libcc/mon/brk.e
Normal file
|
@ -0,0 +1,10 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $brk
|
||||
pro $brk,0
|
||||
lal 0
|
||||
loi EM_PSIZE
|
||||
str 2 ; The - possibly - occurring traps should be caught
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
end
|
16
lang/cem/libcc/mon/chdir.e
Normal file
16
lang/cem/libcc/mon/chdir.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $chdir
|
||||
pro $chdir,0
|
||||
lal 0
|
||||
loi EM_PSIZE
|
||||
loc 12
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
16
lang/cem/libcc/mon/chmod.e
Normal file
16
lang/cem/libcc/mon/chmod.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $chmod
|
||||
pro $chmod,0
|
||||
lal 0
|
||||
loi EM_WSIZE+EM_PSIZE
|
||||
loc 15
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
16
lang/cem/libcc/mon/chown.e
Normal file
16
lang/cem/libcc/mon/chown.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $chown
|
||||
pro $chown,0
|
||||
lal 0
|
||||
loi EM_PSIZE+2*EM_WSIZE
|
||||
loc 16
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
16
lang/cem/libcc/mon/chroot.e
Normal file
16
lang/cem/libcc/mon/chroot.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $chroot
|
||||
pro $chroot,0
|
||||
lal 0
|
||||
loi EM_PSIZE
|
||||
loc 61
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
1
lang/cem/libcc/mon/cleanup.c
Normal file
1
lang/cem/libcc/mon/cleanup.c
Normal file
|
@ -0,0 +1 @@
|
|||
_cleanup(){}
|
15
lang/cem/libcc/mon/close.e
Normal file
15
lang/cem/libcc/mon/close.e
Normal file
|
@ -0,0 +1,15 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $close
|
||||
pro $close,0
|
||||
lol 0
|
||||
loc 6
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
14
lang/cem/libcc/mon/creat.e
Normal file
14
lang/cem/libcc/mon/creat.e
Normal file
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $creat
|
||||
pro $creat,0
|
||||
lal 0
|
||||
loi EM_WSIZE+EM_PSIZE
|
||||
loc 8
|
||||
mon
|
||||
zeq *1
|
||||
ste errno ; since e==r0
|
||||
loc -1
|
||||
1
|
||||
ret EM_WSIZE
|
||||
end
|
14
lang/cem/libcc/mon/dup.e
Normal file
14
lang/cem/libcc/mon/dup.e
Normal file
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $dup
|
||||
pro $dup,0
|
||||
lol 0
|
||||
dup EM_WSIZE
|
||||
loc 41
|
||||
mon
|
||||
zeq *1
|
||||
ste errno
|
||||
loc -1
|
||||
1
|
||||
ret EM_WSIZE
|
||||
end
|
16
lang/cem/libcc/mon/dup2.e
Normal file
16
lang/cem/libcc/mon/dup2.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $dup2
|
||||
pro $dup2,0
|
||||
lal 0
|
||||
loi 2*EM_WSIZE
|
||||
loc 64
|
||||
ior EM_WSIZE
|
||||
loc 41
|
||||
mon
|
||||
zeq *1
|
||||
ste errno
|
||||
loc -1
|
||||
1
|
||||
ret EM_WSIZE
|
||||
end
|
6
lang/cem/libcc/mon/errno.e
Normal file
6
lang/cem/libcc/mon/errno.e
Normal file
|
@ -0,0 +1,6 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
|
||||
exa errno
|
||||
errno
|
||||
bss EM_WSIZE,0,0
|
15
lang/cem/libcc/mon/execl.e
Normal file
15
lang/cem/libcc/mon/execl.e
Normal file
|
@ -0,0 +1,15 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $execl
|
||||
pro $execl,0
|
||||
lae _penvp
|
||||
loi EM_PSIZE
|
||||
lal EM_PSIZE
|
||||
lal 0
|
||||
loi EM_PSIZE
|
||||
loc 59
|
||||
mon
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
25
lang/cem/libcc/mon/execle.e
Normal file
25
lang/cem/libcc/mon/execle.e
Normal file
|
@ -0,0 +1,25 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $execle
|
||||
pro $execle,0
|
||||
lal EM_PSIZE
|
||||
1
|
||||
dup EM_PSIZE
|
||||
loi EM_PSIZE
|
||||
zer EM_PSIZE
|
||||
cmp
|
||||
zeq *2
|
||||
adp EM_PSIZE
|
||||
bra *1
|
||||
2
|
||||
adp EM_PSIZE
|
||||
loi EM_PSIZE
|
||||
lal EM_PSIZE
|
||||
lal 0
|
||||
loi EM_PSIZE
|
||||
loc 59
|
||||
mon
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
14
lang/cem/libcc/mon/execv.e
Normal file
14
lang/cem/libcc/mon/execv.e
Normal file
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $execv
|
||||
pro $execv,0
|
||||
lae _penvp
|
||||
loi EM_PSIZE
|
||||
lal 0
|
||||
loi 2*EM_PSIZE
|
||||
loc 59
|
||||
mon
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
12
lang/cem/libcc/mon/execve.e
Normal file
12
lang/cem/libcc/mon/execve.e
Normal file
|
@ -0,0 +1,12 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $execve
|
||||
pro $execve,0
|
||||
lal 0
|
||||
loi 3*EM_PSIZE
|
||||
loc 59
|
||||
mon
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
24
lang/cem/libcc/mon/exit.c
Normal file
24
lang/cem/libcc/mon/exit.c
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
||||
*
|
||||
* This product is part of the Amsterdam Compiler Kit
|
||||
* developed by Andrew S. Tanenbaum, Johan W. Stevenson,
|
||||
* Ed Keizer and Hans van Staveren of the Vrije Universiteit.
|
||||
*
|
||||
* Permission to use, sell, duplicate or disclose this software must be
|
||||
* obtained in writing. Requests for such permissions may be sent to
|
||||
*
|
||||
* Dr. Andrew S. Tanenbaum
|
||||
* Wiskundig Seminarium
|
||||
* Vrije Universiteit
|
||||
* Postbox 7161
|
||||
* 1007 MC Amsterdam
|
||||
* The Netherlands
|
||||
*
|
||||
*/
|
||||
|
||||
exit(code)
|
||||
{
|
||||
_cleanup() ;
|
||||
_exit(code) ;
|
||||
}
|
21
lang/cem/libcc/mon/fork.e
Normal file
21
lang/cem/libcc/mon/fork.e
Normal file
|
@ -0,0 +1,21 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exa par_uid
|
||||
par_uid
|
||||
bss EM_WSIZE,0,0
|
||||
|
||||
exp $fork
|
||||
pro $fork,0
|
||||
loc 2
|
||||
mon
|
||||
zeq *1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
1
|
||||
zeq *2
|
||||
ste par_uid
|
||||
loc 0
|
||||
2
|
||||
ret EM_WSIZE
|
||||
end
|
16
lang/cem/libcc/mon/fstat.e
Normal file
16
lang/cem/libcc/mon/fstat.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $fstat
|
||||
pro $fstat,0
|
||||
lal 0
|
||||
loi EM_WSIZE+EM_PSIZE
|
||||
loc 28
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
10
lang/cem/libcc/mon/ftime.e
Normal file
10
lang/cem/libcc/mon/ftime.e
Normal file
|
@ -0,0 +1,10 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $ftime
|
||||
pro $ftime,0
|
||||
lal 0
|
||||
loi EM_PSIZE
|
||||
loc 35
|
||||
mon
|
||||
ret 0
|
||||
end
|
8
lang/cem/libcc/mon/getegid.e
Normal file
8
lang/cem/libcc/mon/getegid.e
Normal file
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $getegid
|
||||
pro $getegid,0
|
||||
loc 47
|
||||
mon
|
||||
ret EM_WSIZE
|
||||
end
|
8
lang/cem/libcc/mon/geteuid.e
Normal file
8
lang/cem/libcc/mon/geteuid.e
Normal file
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $geteuid
|
||||
pro $geteuid,0
|
||||
loc 24
|
||||
mon
|
||||
ret EM_WSIZE
|
||||
end
|
9
lang/cem/libcc/mon/getgid.e
Normal file
9
lang/cem/libcc/mon/getgid.e
Normal file
|
@ -0,0 +1,9 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $getgid
|
||||
pro $getgid,0
|
||||
loc 47
|
||||
mon
|
||||
asp EM_WSIZE
|
||||
ret EM_WSIZE
|
||||
end
|
8
lang/cem/libcc/mon/getpid.e
Normal file
8
lang/cem/libcc/mon/getpid.e
Normal file
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $getpid
|
||||
pro $getpid,0
|
||||
loc 20
|
||||
mon
|
||||
ret EM_WSIZE
|
||||
end
|
9
lang/cem/libcc/mon/getuid.e
Normal file
9
lang/cem/libcc/mon/getuid.e
Normal file
|
@ -0,0 +1,9 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $getuid
|
||||
pro $getuid,0
|
||||
loc 24
|
||||
mon
|
||||
asp EM_WSIZE
|
||||
ret EM_WSIZE
|
||||
end
|
4
lang/cem/libcc/mon/gtty.c
Normal file
4
lang/cem/libcc/mon/gtty.c
Normal file
|
@ -0,0 +1,4 @@
|
|||
#include <sgtty.h>
|
||||
int gtty(fildes,argp) int fildes ; struct sgttyb *argp ; {
|
||||
return ioctl(fildes,TIOCGETP,argp) ;
|
||||
}
|
16
lang/cem/libcc/mon/ioctl.e
Normal file
16
lang/cem/libcc/mon/ioctl.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $ioctl
|
||||
pro $ioctl,0
|
||||
lal 0
|
||||
loi EM_PSIZE+2*EM_WSIZE
|
||||
loc 54
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
15
lang/cem/libcc/mon/kill.e
Normal file
15
lang/cem/libcc/mon/kill.e
Normal file
|
@ -0,0 +1,15 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $kill
|
||||
pro $kill,0
|
||||
ldl 0
|
||||
loc 37
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
16
lang/cem/libcc/mon/link.e
Normal file
16
lang/cem/libcc/mon/link.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $link
|
||||
pro $link,0
|
||||
lal 0
|
||||
loi 2*EM_PSIZE
|
||||
loc 9
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
15
lang/cem/libcc/mon/lock.e
Normal file
15
lang/cem/libcc/mon/lock.e
Normal file
|
@ -0,0 +1,15 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $lock
|
||||
pro $lock,0
|
||||
lol 0
|
||||
loc 53
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
25
lang/cem/libcc/mon/lseek.e
Normal file
25
lang/cem/libcc/mon/lseek.e
Normal file
|
@ -0,0 +1,25 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $lseek
|
||||
pro $lseek,0
|
||||
lal 0
|
||||
loi 4*EM_WSIZE
|
||||
loc 19
|
||||
mon
|
||||
zeq *1
|
||||
ste errno
|
||||
#if EM_WSIZE==1
|
||||
ldc -1
|
||||
loc 2
|
||||
loc 4
|
||||
cii
|
||||
#endif
|
||||
#if EM_WSIZE==2
|
||||
ldc -1
|
||||
#endif
|
||||
#if EM_WSIZE==4
|
||||
loc -1
|
||||
#endif
|
||||
1
|
||||
ret 2*EM_WSIZE
|
||||
end
|
16
lang/cem/libcc/mon/mknod.e
Normal file
16
lang/cem/libcc/mon/mknod.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $mknod
|
||||
pro $mknod,0
|
||||
lal 0
|
||||
loi EM_PSIZE+2*EM_WSIZE
|
||||
loc 14
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
16
lang/cem/libcc/mon/mount.e
Normal file
16
lang/cem/libcc/mon/mount.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $mount
|
||||
pro $mount,0
|
||||
lal 0
|
||||
loi EM_WSIZE+2*EM_PSIZE
|
||||
loc 21
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
16
lang/cem/libcc/mon/mpxcall.e
Normal file
16
lang/cem/libcc/mon/mpxcall.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $mpxcall
|
||||
pro $mpxcall,0
|
||||
lal 0
|
||||
loi EM_PSIZE+EM_WSIZE
|
||||
loc 56
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
9
lang/cem/libcc/mon/nice.e
Normal file
9
lang/cem/libcc/mon/nice.e
Normal file
|
@ -0,0 +1,9 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $nice
|
||||
pro $nice,0
|
||||
lol 0
|
||||
loc 34
|
||||
mon
|
||||
ret 0
|
||||
end
|
14
lang/cem/libcc/mon/open.e
Normal file
14
lang/cem/libcc/mon/open.e
Normal file
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $open
|
||||
pro $open,0
|
||||
lal 0
|
||||
loi EM_WSIZE+EM_PSIZE
|
||||
loc 5
|
||||
mon
|
||||
zeq *1
|
||||
ste errno
|
||||
loc -1
|
||||
1
|
||||
ret EM_WSIZE
|
||||
end
|
8
lang/cem/libcc/mon/pause.e
Normal file
8
lang/cem/libcc/mon/pause.e
Normal file
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $pause
|
||||
pro $pause,0
|
||||
loc 29
|
||||
mon
|
||||
ret 0
|
||||
end
|
18
lang/cem/libcc/mon/pipe.e
Normal file
18
lang/cem/libcc/mon/pipe.e
Normal file
|
@ -0,0 +1,18 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $pipe
|
||||
pro $pipe,0
|
||||
loc 42
|
||||
mon
|
||||
zeq *1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
1
|
||||
lal 0
|
||||
loi EM_PSIZE
|
||||
stf EM_WSIZE
|
||||
sil 0
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
end
|
10
lang/cem/libcc/mon/prof.e
Normal file
10
lang/cem/libcc/mon/prof.e
Normal file
|
@ -0,0 +1,10 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $profil
|
||||
pro $profil,0
|
||||
lal 0
|
||||
loi 4*EM_PSIZE
|
||||
loc 44
|
||||
mon
|
||||
ret 0
|
||||
end
|
15
lang/cem/libcc/mon/ptrace.e
Normal file
15
lang/cem/libcc/mon/ptrace.e
Normal file
|
@ -0,0 +1,15 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $ptrace
|
||||
pro $ptrace,0
|
||||
zre errno
|
||||
lal 0
|
||||
loi EM_PSIZE+3*EM_WSIZE
|
||||
loc 26
|
||||
mon
|
||||
zeq *1
|
||||
ste errno
|
||||
loc -1
|
||||
1
|
||||
ret EM_WSIZE
|
||||
end
|
23
lang/cem/libcc/mon/read.e
Normal file
23
lang/cem/libcc/mon/read.e
Normal file
|
@ -0,0 +1,23 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $read
|
||||
pro $read,0
|
||||
lol EM_WSIZE+EM_PSIZE
|
||||
loc EM_WSIZE
|
||||
loc EM_PSIZE
|
||||
ciu
|
||||
lal 0
|
||||
loi EM_WSIZE+EM_PSIZE
|
||||
loc 3
|
||||
mon
|
||||
zne *1
|
||||
loc EM_PSIZE
|
||||
loc EM_WSIZE
|
||||
cui
|
||||
bra *2
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
2
|
||||
ret EM_WSIZE
|
||||
end
|
11
lang/cem/libcc/mon/sbrk.e
Normal file
11
lang/cem/libcc/mon/sbrk.e
Normal file
|
@ -0,0 +1,11 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $sbrk
|
||||
pro $sbrk,0
|
||||
lor 2
|
||||
lor 2
|
||||
lol 0
|
||||
ads EM_WSIZE
|
||||
str 2 ; The - possibly - occurring traps should be caught
|
||||
ret EM_PSIZE
|
||||
end
|
15
lang/cem/libcc/mon/setgid.e
Normal file
15
lang/cem/libcc/mon/setgid.e
Normal file
|
@ -0,0 +1,15 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $setgid
|
||||
pro $setgid,0
|
||||
lol 0
|
||||
loc 46
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
45
lang/cem/libcc/mon/setsig.e
Normal file
45
lang/cem/libcc/mon/setsig.e
Normal file
|
@ -0,0 +1,45 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
save
|
||||
bss EM_PSIZE,0,0
|
||||
trf
|
||||
bss EM_PSIZE,0,0
|
||||
|
||||
exp $_setsig
|
||||
pro $_setsig,0
|
||||
lal 0
|
||||
loi EM_PSIZE
|
||||
lae trf
|
||||
sti EM_PSIZE
|
||||
inp $catchit
|
||||
lpi $catchit ; trap to catchit
|
||||
sig
|
||||
lae save ; remember higher level trap
|
||||
sti EM_PSIZE
|
||||
ret 0
|
||||
end
|
||||
|
||||
pro $catchit,0
|
||||
lpi $catchit
|
||||
sig
|
||||
asp EM_PSIZE
|
||||
lol 0 ; fetch trapno
|
||||
lae trf
|
||||
loi EM_PSIZE ; fetch procedure identifier
|
||||
cai
|
||||
lfr EM_WSIZE
|
||||
zne *1
|
||||
; trap not handled by trf function, trap through; trapno still on stack
|
||||
lae save
|
||||
loi EM_PSIZE
|
||||
sig
|
||||
asp EM_PSIZE
|
||||
trp
|
||||
lpi $catchit ; trap ignored, further traps to catchit
|
||||
sig
|
||||
asp EM_PSIZE
|
||||
lae save ; remember higher level trap
|
||||
sti EM_PSIZE
|
||||
1
|
||||
rtt
|
||||
end
|
15
lang/cem/libcc/mon/setuid.e
Normal file
15
lang/cem/libcc/mon/setuid.e
Normal file
|
@ -0,0 +1,15 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $setuid
|
||||
pro $setuid,0
|
||||
lol 0
|
||||
loc 23
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
99
lang/cem/libcc/mon/signal.c
Normal file
99
lang/cem/libcc/mon/signal.c
Normal file
|
@ -0,0 +1,99 @@
|
|||
#include <signal.h>
|
||||
|
||||
typedef int (*callvec)() ;
|
||||
|
||||
static callvec vector[16] = {
|
||||
SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL,
|
||||
SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL
|
||||
} ;
|
||||
|
||||
static char mapvec[] = {
|
||||
0, /* EARRAY */
|
||||
0, /* ERANGE */
|
||||
0, /* ESET */
|
||||
0, /* EIOVFL */
|
||||
SIGFPE, /* EFOVFL */
|
||||
SIGFPE, /* EFUNDFL */
|
||||
0, /* EIDIVZ */
|
||||
SIGFPE, /* EFDIVZ */
|
||||
0, /* EIUND, already ignored */
|
||||
SIGFPE, /* EFUND */
|
||||
0, /* ECONV */
|
||||
0, /* 11 */
|
||||
0, /* 12 */
|
||||
0, /* 13 */
|
||||
0, /* 14 */
|
||||
0, /* 15 */
|
||||
SIGSEGV, /* ESTACK */
|
||||
SIGSEGV, /* EHEAP */
|
||||
0, /* EILLINS */
|
||||
0, /* EODDZ */
|
||||
0, /* ECASE */
|
||||
SIGSEGV, /* EBADMEM */
|
||||
SIGBUS, /* EBADPTR */
|
||||
0, /* EBADPC */
|
||||
0, /* EBADLAE */
|
||||
SIGSYS, /* EBADMON */
|
||||
0, /* EBADLIN */
|
||||
0, /* EBADGTO */
|
||||
} ;
|
||||
|
||||
#define VECBASE 128
|
||||
|
||||
static firsttime = 1 ;
|
||||
static int catchtrp() ;
|
||||
static int procesig() ;
|
||||
|
||||
callvec signal(sig,func) int sig ; callvec func ; {
|
||||
register index, i ;
|
||||
callvec prev ;
|
||||
|
||||
index= sig-1 ;
|
||||
if ( index<0 || index>=(sizeof vector/sizeof vector[0]) ) {
|
||||
return (callvec) -1 ;
|
||||
}
|
||||
if ( firsttime ) {
|
||||
firsttime= 0 ;
|
||||
_setsig(catchtrp) ;
|
||||
}
|
||||
prev= vector[index] ;
|
||||
if ( prev!=func ) {
|
||||
register int mapval ;
|
||||
vector[index]= func ;
|
||||
if ( func==SIG_IGN ) {
|
||||
mapval= -3;
|
||||
} else if ( func==SIG_DFL ) {
|
||||
mapval= -2;
|
||||
} else {
|
||||
mapval=VECBASE+sig;
|
||||
}
|
||||
if ( sigtrp(mapval,sig)== -1 ) return (callvec) -1;
|
||||
|
||||
}
|
||||
return prev ;
|
||||
}
|
||||
|
||||
static int catchtrp(trapno) int trapno ; {
|
||||
if ( trapno>VECBASE &&
|
||||
trapno<=VECBASE + (sizeof vector/sizeof vector[0]) ) {
|
||||
return procesig(trapno-VECBASE) ;
|
||||
}
|
||||
if ( trapno>=0 && trapno< (sizeof mapvec/sizeof mapvec[0]) &&
|
||||
mapvec[trapno] ) {
|
||||
return procesig(mapvec[trapno]) ;
|
||||
}
|
||||
return 0 ; /* Failed to handle the trap */
|
||||
}
|
||||
|
||||
static int procesig(sig) int sig ; {
|
||||
register index ;
|
||||
callvec trf ;
|
||||
|
||||
index= sig-1 ;
|
||||
trf= vector[index] ;
|
||||
if ( trf==SIG_IGN ) return 1 ;
|
||||
if ( sig!=SIGILL && sig!=SIGTRAP ) vector[index]= SIG_IGN ;
|
||||
if ( trf==SIG_DFL ) return 0 ;
|
||||
(*trf)(sig) ;
|
||||
return 1 ;
|
||||
}
|
13
lang/cem/libcc/mon/sigtrp.e
Normal file
13
lang/cem/libcc/mon/sigtrp.e
Normal file
|
@ -0,0 +1,13 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $sigtrp
|
||||
pro $sigtrp,0
|
||||
ldl 0
|
||||
loc 48
|
||||
mon
|
||||
zeq *1
|
||||
ste errno
|
||||
loc -1
|
||||
1
|
||||
ret EM_WSIZE
|
||||
end
|
16
lang/cem/libcc/mon/stat.e
Normal file
16
lang/cem/libcc/mon/stat.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $stat
|
||||
pro $stat,0
|
||||
lal 0
|
||||
loi 2*EM_PSIZE
|
||||
loc 18
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
20
lang/cem/libcc/mon/stime.e
Normal file
20
lang/cem/libcc/mon/stime.e
Normal file
|
@ -0,0 +1,20 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $stime
|
||||
pro $stime,0
|
||||
#if EM_WSIZE<4
|
||||
lol 0
|
||||
loi 4
|
||||
#else
|
||||
lil 0
|
||||
#endif
|
||||
loc 25
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
4
lang/cem/libcc/mon/stty.c
Normal file
4
lang/cem/libcc/mon/stty.c
Normal file
|
@ -0,0 +1,4 @@
|
|||
#include <sgtty.h>
|
||||
int stty(fildes,argp) int fildes ; struct sgttyb *argp ; {
|
||||
return ioctl(fildes,TIOCSETP,argp) ;
|
||||
}
|
8
lang/cem/libcc/mon/sync.e
Normal file
8
lang/cem/libcc/mon/sync.e
Normal file
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $sync
|
||||
pro $sync,0
|
||||
loc 36
|
||||
mon
|
||||
ret 0
|
||||
end
|
10
lang/cem/libcc/mon/tell.c
Normal file
10
lang/cem/libcc/mon/tell.c
Normal file
|
@ -0,0 +1,10 @@
|
|||
/*
|
||||
* return offset in file.
|
||||
*/
|
||||
|
||||
long lseek();
|
||||
|
||||
long tell(f)
|
||||
{
|
||||
return(lseek(f, 0L, 1));
|
||||
}
|
9
lang/cem/libcc/mon/time.c
Normal file
9
lang/cem/libcc/mon/time.c
Normal file
|
@ -0,0 +1,9 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/timeb.h>
|
||||
time_t time(timpt) time_t *timpt ; {
|
||||
struct timeb buf ;
|
||||
|
||||
ftime(&buf) ;
|
||||
if ( timpt ) *timpt= buf.time ;
|
||||
return buf.time ;
|
||||
}
|
10
lang/cem/libcc/mon/times.e
Normal file
10
lang/cem/libcc/mon/times.e
Normal file
|
@ -0,0 +1,10 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $times
|
||||
pro $times,0
|
||||
lal 0
|
||||
loi EM_PSIZE
|
||||
loc 43
|
||||
mon
|
||||
ret 0
|
||||
end
|
9
lang/cem/libcc/mon/umask.e
Normal file
9
lang/cem/libcc/mon/umask.e
Normal file
|
@ -0,0 +1,9 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $umask
|
||||
pro $umask,0
|
||||
lol 0
|
||||
loc 60
|
||||
mon
|
||||
ret EM_WSIZE
|
||||
end
|
16
lang/cem/libcc/mon/umount.e
Normal file
16
lang/cem/libcc/mon/umount.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $umount
|
||||
pro $umount,0
|
||||
lal 0
|
||||
loi EM_PSIZE
|
||||
loc 22
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
16
lang/cem/libcc/mon/unlink.e
Normal file
16
lang/cem/libcc/mon/unlink.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $unlink
|
||||
pro $unlink,0
|
||||
lal 0
|
||||
loi EM_PSIZE
|
||||
loc 10
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
16
lang/cem/libcc/mon/utime.e
Normal file
16
lang/cem/libcc/mon/utime.e
Normal file
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $utime
|
||||
pro $utime,0
|
||||
lal 0
|
||||
loi 2*EM_PSIZE
|
||||
loc 30
|
||||
mon
|
||||
zne *1
|
||||
loc 0
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
33
lang/cem/libcc/mon/wait.e
Normal file
33
lang/cem/libcc/mon/wait.e
Normal file
|
@ -0,0 +1,33 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
#if EM_WSIZE<4
|
||||
#define STATUS_SIZE 2
|
||||
#else
|
||||
#define STATUS_SIZE EM_WSIZE
|
||||
#endif
|
||||
exp $wait
|
||||
pro $wait,0
|
||||
loc 7
|
||||
mon
|
||||
zne *1
|
||||
lal 0
|
||||
loi EM_PSIZE
|
||||
zer EM_PSIZE
|
||||
cms EM_PSIZE
|
||||
zeq *2
|
||||
#if EM_WSIZE==1
|
||||
lal 0
|
||||
loi EM_PSIZE
|
||||
sti 2 ; 2 bytes, not one int!
|
||||
#else
|
||||
sil 0
|
||||
#endif
|
||||
ret EM_WSIZE
|
||||
2
|
||||
asp STATUS_SIZE
|
||||
ret EM_WSIZE
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
ret EM_WSIZE
|
||||
end
|
23
lang/cem/libcc/mon/write.e
Normal file
23
lang/cem/libcc/mon/write.e
Normal file
|
@ -0,0 +1,23 @@
|
|||
#
|
||||
mes 2,EM_WSIZE,EM_PSIZE
|
||||
exp $write
|
||||
pro $write,0
|
||||
lol EM_WSIZE+EM_PSIZE
|
||||
loc EM_WSIZE
|
||||
loc EM_PSIZE
|
||||
ciu
|
||||
lal 0
|
||||
loi EM_WSIZE+EM_PSIZE
|
||||
loc 4
|
||||
mon
|
||||
zne *1
|
||||
loc EM_PSIZE
|
||||
loc EM_WSIZE
|
||||
cui
|
||||
bra *2
|
||||
1
|
||||
ste errno
|
||||
loc -1
|
||||
2
|
||||
ret EM_WSIZE
|
||||
end
|
Loading…
Reference in a new issue