@@ -22,7 +22,6 @@ execl.e
execle.e
execv.e
execve.e
-_exit.e
fork.e
fstat.e
ftime.e
@@ -62,3 +61,28 @@ utime.e
wait.e
write.e
errno.e
+_alarm.e
+_brk.e
+_close.e
+_creat.e
+_dup.e
+_dup2.e
+_execl.e
+_exit.e
+_fork.e
+_fstat.e
+_ftime.e
+_getpid.e
+_gtty.c
+_ioctl.e
+_kill.e
+_link.e
+_lseek.e
+_open.e
+_pause.e
+_pipe.e
+_read.e
+_sbrk.e
+_unlink.e
+_wait.e
+_write.e
@@ -0,0 +1,9 @@
+#
+ mes 2,EM_WSIZE,EM_PSIZE
+ exp $_alarm
+ pro $_alarm,0
+ lol 0
+ loc 27
+ mon
+ ret EM_WSIZE
+ end
@@ -0,0 +1,54 @@
+#include <em_abs.h>
+
+.1
+ bss EM_PSIZE,0,0
+.2
+ bss EM_WSIZE,0,0
+ pro $ctch,0
+ loc EHEAP
+ beq *1
+ lae .1
+ loi EM_PSIZE
+ sig
+ asp EM_PSIZE
+ trp
+ rtt
+1
+ loc 1
+ ste .2
+ exp $_brk
+ pro $_brk,0
+ lpi $ctch
+ sti EM_PSIZE
+ loc 0
+ lal 0
+ str 2 ; The - possibly - occurring trap is caught
+ loe .2
+ zgt *1
+ zer EM_PSIZE
+ ret EM_PSIZE
+ loc -1
+ loc EM_WSIZE
+ loc EM_PSIZE
+ cii
@@ -0,0 +1,15 @@
+ exp $_close
+ pro $_close,0
+ loc 6
+ zne *1
+ ste errno
@@ -0,0 +1,14 @@
+ exp $_creat
+ pro $_creat,0
+ loi EM_WSIZE+EM_PSIZE
+ loc 8
+ zeq *1
+ ste errno ; since e==r0
+ exp $_dup
+ pro $_dup,0
+ _dup EM_WSIZE
+ loc 41
@@ -0,0 +1,16 @@
+ exp $_dup2
+ pro $_dup2,0
+ loi 2*EM_WSIZE
+ loc 64
+ ior EM_WSIZE
+ exp $_execl
+ pro $_execl,0
+ lae _penvp
+ lal EM_PSIZE
+ loc 59
@@ -0,0 +1,18 @@
+ exp $_fork
+ pro $_fork,0
+ loc 2
+ zeq *2
+ asp EM_WSIZE
+2
+ exp $_fstat
+ pro $_fstat,0
+ loc 28
@@ -0,0 +1,10 @@
+ exp $_ftime
+ pro $_ftime,0
+ loc 35
+ ret 0
@@ -0,0 +1,8 @@
+ exp $_getpid
+ pro $_getpid,0
+ loc 20
@@ -0,0 +1,6 @@
+/* $Header$ */
+#include <sgtty.h>
+int
+_gtty(fildes,argp) int fildes ; struct sgttyb *argp ; {
+ return _ioctl(fildes,TIOCGETP,argp) ;
+}
+ exp $_ioctl
+ pro $_ioctl,0
+ loi EM_PSIZE+2*EM_WSIZE
+ loc 54
+ exp $_kill
+ pro $_kill,0
+ ldl 0
+ loc 37
+ exp $_link
+ pro $_link,0
+ loi 2*EM_PSIZE
+ loc 9
@@ -0,0 +1,33 @@
+ exp $_lseek
+ pro $_lseek,0
+ loi 4*EM_WSIZE
+ loc 19
+#if EM_WSIZE==1
+ ldc -1
+ loc 4
+#endif
+#if EM_WSIZE==2
+#if EM_WSIZE==4
+ ret 4*EM_WSIZE
+ ret 2*EM_WSIZE
+ exp $_open
+ pro $_open,0
+ loc 5
+ exp $_pause
+ pro $_pause,0
+ loc 29
+ exp $_pipe
+ pro $_pipe,0
+ loc 42
+ stf EM_WSIZE
+ sil 0
@@ -0,0 +1,23 @@
+ exp $_read
+ pro $_read,0
+ lol EM_WSIZE+EM_PSIZE
+ ciu
+ loc 3
+ cui
+ bra *2
@@ -0,0 +1,60 @@
+ exp $_sbrk
+ pro $_sbrk,0
+ lor 2
+ ads EM_WSIZE ; this is the new heap pointer, but watch out for overflow!
+ dup EM_PSIZE
+ cmp ; compare with old heap pointer
+ zlt *1
+ exp $_unlink
+ pro $_unlink,0
+ loc 10
+#if EM_WSIZE<4
+#define STATUS_SIZE 2
+#else
+#define STATUS_SIZE EM_WSIZE
+ exp $_wait
+ pro $_wait,0
+ loc 7
+ cms EM_PSIZE
+ sti 2 ; 2 bytes, not one int!
+ asp STATUS_SIZE
+ exp $_write
+ pro $_write,0
@@ -1,5 +1,6 @@
/* $Header$ */
#include <sgtty.h>
-int gtty(fildes,argp) int fildes ; struct sgttyb *argp ; {
+gtty(fildes,argp) int fildes ; struct sgttyb *argp ; {
return ioctl(fildes,TIOCGETP,argp) ;
}
-int stty(fildes,argp) int fildes ; struct sgttyb *argp ; {
+stty(fildes,argp) int fildes ; struct sgttyb *argp ; {
return ioctl(fildes,TIOCSETP,argp) ;
@@ -1,7 +1,8 @@
#include <sys/types.h>
#include <sys/timeb.h>
-time_t time(timpt) time_t *timpt ; {
+time_t
+time(timpt) time_t *timpt ; {
struct timeb buf ;
ftime(&buf) ;