Added entry points for ANSI C
authorceriel <none@none>
Mon, 22 Jan 1990 11:48:01 +0000 (11:48 +0000)
committerceriel <none@none>
Mon, 22 Jan 1990 11:48:01 +0000 (11:48 +0000)
28 files changed:
lang/cem/libcc/mon/LIST
lang/cem/libcc/mon/_alarm.e [new file with mode: 0644]
lang/cem/libcc/mon/_brk.e [new file with mode: 0644]
lang/cem/libcc/mon/_close.e [new file with mode: 0644]
lang/cem/libcc/mon/_creat.e [new file with mode: 0644]
lang/cem/libcc/mon/_dup.e [new file with mode: 0644]
lang/cem/libcc/mon/_dup2.e [new file with mode: 0644]
lang/cem/libcc/mon/_execl.e [new file with mode: 0644]
lang/cem/libcc/mon/_fork.e [new file with mode: 0644]
lang/cem/libcc/mon/_fstat.e [new file with mode: 0644]
lang/cem/libcc/mon/_ftime.e [new file with mode: 0644]
lang/cem/libcc/mon/_getpid.e [new file with mode: 0644]
lang/cem/libcc/mon/_gtty.c [new file with mode: 0644]
lang/cem/libcc/mon/_ioctl.e [new file with mode: 0644]
lang/cem/libcc/mon/_kill.e [new file with mode: 0644]
lang/cem/libcc/mon/_link.e [new file with mode: 0644]
lang/cem/libcc/mon/_lseek.e [new file with mode: 0644]
lang/cem/libcc/mon/_open.e [new file with mode: 0644]
lang/cem/libcc/mon/_pause.e [new file with mode: 0644]
lang/cem/libcc/mon/_pipe.e [new file with mode: 0644]
lang/cem/libcc/mon/_read.e [new file with mode: 0644]
lang/cem/libcc/mon/_sbrk.e [new file with mode: 0644]
lang/cem/libcc/mon/_unlink.e [new file with mode: 0644]
lang/cem/libcc/mon/_wait.e [new file with mode: 0644]
lang/cem/libcc/mon/_write.e [new file with mode: 0644]
lang/cem/libcc/mon/gtty.c
lang/cem/libcc/mon/stty.c
lang/cem/libcc/mon/time.c

index 635b74b..f7cf6d7 100644 (file)
@@ -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
diff --git a/lang/cem/libcc/mon/_alarm.e b/lang/cem/libcc/mon/_alarm.e
new file mode 100644 (file)
index 0000000..dc530b2
--- /dev/null
@@ -0,0 +1,9 @@
+#
+ mes 2,EM_WSIZE,EM_PSIZE
+ exp $_alarm
+ pro $_alarm,0
+ lol 0
+ loc 27
+ mon
+ ret EM_WSIZE
+ end
diff --git a/lang/cem/libcc/mon/_brk.e b/lang/cem/libcc/mon/_brk.e
new file mode 100644 (file)
index 0000000..d7dd6e4
--- /dev/null
@@ -0,0 +1,54 @@
+#
+#include <em_abs.h>
+
+ mes 2,EM_WSIZE,EM_PSIZE
+
+.1
+ bss EM_PSIZE,0,0
+.2
+ bss EM_WSIZE,0,0
+
+ pro $ctch,0
+ lol 0
+ loc EHEAP
+ beq *1
+ lae .1
+ loi EM_PSIZE
+ sig
+ asp EM_PSIZE
+ lol 0
+ trp
+ rtt
+1
+ loc 1
+ ste .2
+ rtt
+ end
+
+
+ exp $_brk
+ pro $_brk,0
+ lpi $ctch
+ sig
+ lae .1
+ sti EM_PSIZE
+ loc 0
+ ste .2
+ lal 0
+ loi EM_PSIZE
+ str 2          ; The - possibly - occurring trap is caught
+ lae .1
+ loi EM_PSIZE
+ sig
+ asp EM_PSIZE
+ loe .2
+ zgt *1
+ zer EM_PSIZE
+ ret EM_PSIZE
+1
+ loc -1
+ loc EM_WSIZE
+ loc EM_PSIZE
+ cii
+ ret EM_PSIZE
+ end
diff --git a/lang/cem/libcc/mon/_close.e b/lang/cem/libcc/mon/_close.e
new file mode 100644 (file)
index 0000000..e22c982
--- /dev/null
@@ -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
diff --git a/lang/cem/libcc/mon/_creat.e b/lang/cem/libcc/mon/_creat.e
new file mode 100644 (file)
index 0000000..0d883dd
--- /dev/null
@@ -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
diff --git a/lang/cem/libcc/mon/_dup.e b/lang/cem/libcc/mon/_dup.e
new file mode 100644 (file)
index 0000000..b34d270
--- /dev/null
@@ -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
diff --git a/lang/cem/libcc/mon/_dup2.e b/lang/cem/libcc/mon/_dup2.e
new file mode 100644 (file)
index 0000000..719e3a1
--- /dev/null
@@ -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
diff --git a/lang/cem/libcc/mon/_execl.e b/lang/cem/libcc/mon/_execl.e
new file mode 100644 (file)
index 0000000..1fcdfd7
--- /dev/null
@@ -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
diff --git a/lang/cem/libcc/mon/_fork.e b/lang/cem/libcc/mon/_fork.e
new file mode 100644 (file)
index 0000000..6104140
--- /dev/null
@@ -0,0 +1,18 @@
+#
+ mes 2,EM_WSIZE,EM_PSIZE
+
+ exp $_fork
+ pro $_fork,0
+ loc 2
+ mon
+ zeq *1
+ ste errno
+ loc -1
+ ret EM_WSIZE
+1
+ zeq *2
+ asp EM_WSIZE
+ loc 0
+2
+ ret EM_WSIZE
+ end
diff --git a/lang/cem/libcc/mon/_fstat.e b/lang/cem/libcc/mon/_fstat.e
new file mode 100644 (file)
index 0000000..336e1c8
--- /dev/null
@@ -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
diff --git a/lang/cem/libcc/mon/_ftime.e b/lang/cem/libcc/mon/_ftime.e
new file mode 100644 (file)
index 0000000..3979fac
--- /dev/null
@@ -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
diff --git a/lang/cem/libcc/mon/_getpid.e b/lang/cem/libcc/mon/_getpid.e
new file mode 100644 (file)
index 0000000..c4527b9
--- /dev/null
@@ -0,0 +1,8 @@
+#
+ mes 2,EM_WSIZE,EM_PSIZE
+ exp $_getpid
+ pro $_getpid,0
+ loc 20
+ mon
+ ret EM_WSIZE
+ end
diff --git a/lang/cem/libcc/mon/_gtty.c b/lang/cem/libcc/mon/_gtty.c
new file mode 100644 (file)
index 0000000..972351f
--- /dev/null
@@ -0,0 +1,6 @@
+/* $Header$ */
+#include <sgtty.h>
+int
+_gtty(fildes,argp) int fildes ; struct sgttyb *argp ; {
+       return _ioctl(fildes,TIOCGETP,argp) ;
+}
diff --git a/lang/cem/libcc/mon/_ioctl.e b/lang/cem/libcc/mon/_ioctl.e
new file mode 100644 (file)
index 0000000..ce41262
--- /dev/null
@@ -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
diff --git a/lang/cem/libcc/mon/_kill.e b/lang/cem/libcc/mon/_kill.e
new file mode 100644 (file)
index 0000000..fed5ec7
--- /dev/null
@@ -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
diff --git a/lang/cem/libcc/mon/_link.e b/lang/cem/libcc/mon/_link.e
new file mode 100644 (file)
index 0000000..21d3a86
--- /dev/null
@@ -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
diff --git a/lang/cem/libcc/mon/_lseek.e b/lang/cem/libcc/mon/_lseek.e
new file mode 100644 (file)
index 0000000..a2b160a
--- /dev/null
@@ -0,0 +1,33 @@
+#
+ 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
+#if EM_WSIZE==1
+ ret 4*EM_WSIZE
+#endif
+#if EM_WSIZE==2
+ ret 2*EM_WSIZE
+#endif
+#if EM_WSIZE==4
+ ret EM_WSIZE
+#endif
+ end
diff --git a/lang/cem/libcc/mon/_open.e b/lang/cem/libcc/mon/_open.e
new file mode 100644 (file)
index 0000000..0f3d511
--- /dev/null
@@ -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
diff --git a/lang/cem/libcc/mon/_pause.e b/lang/cem/libcc/mon/_pause.e
new file mode 100644 (file)
index 0000000..81a9cab
--- /dev/null
@@ -0,0 +1,8 @@
+#
+ mes 2,EM_WSIZE,EM_PSIZE
+ exp $_pause
+ pro $_pause,0
+ loc 29
+ mon
+ ret 0
+ end
diff --git a/lang/cem/libcc/mon/_pipe.e b/lang/cem/libcc/mon/_pipe.e
new file mode 100644 (file)
index 0000000..faed4f6
--- /dev/null
@@ -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
diff --git a/lang/cem/libcc/mon/_read.e b/lang/cem/libcc/mon/_read.e
new file mode 100644 (file)
index 0000000..0c47d27
--- /dev/null
@@ -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
diff --git a/lang/cem/libcc/mon/_sbrk.e b/lang/cem/libcc/mon/_sbrk.e
new file mode 100644 (file)
index 0000000..cd59228
--- /dev/null
@@ -0,0 +1,60 @@
+#
+#include <em_abs.h>
+
+ mes 2,EM_WSIZE,EM_PSIZE
+
+.1
+ bss EM_PSIZE,0,0
+.2
+ bss EM_WSIZE,0,0
+
+ pro $ctch,0
+ lol 0
+ loc EHEAP
+ beq *1
+ lae .1
+ loi EM_PSIZE
+ sig
+ asp EM_PSIZE
+ lol 0
+ trp
+ rtt
+1
+ loc 1
+ ste .2
+ rtt
+ end
+
+
+ exp $_sbrk
+ pro $_sbrk,0
+ lor 2
+ lor 2
+ lpi $ctch
+ sig
+ lae .1
+ sti EM_PSIZE
+ loc 0
+ ste .2
+ lol 0
+ ads EM_WSIZE  ; this is the new heap pointer, but watch out for overflow!
+ dup EM_PSIZE
+ lor 2
+ cmp           ; compare with old heap pointer
+ zlt *1
+ str 2          ; The - possibly - occurring trap is caught
+ lae .1
+ loi EM_PSIZE
+ sig
+ asp EM_PSIZE
+ loe .2
+ zgt *1
+ ret EM_PSIZE
+1
+ asp EM_PSIZE
+ loc -1
+ loc EM_WSIZE
+ loc EM_PSIZE
+ cii
+ ret EM_PSIZE
+ end
diff --git a/lang/cem/libcc/mon/_unlink.e b/lang/cem/libcc/mon/_unlink.e
new file mode 100644 (file)
index 0000000..7a72b3e
--- /dev/null
@@ -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
diff --git a/lang/cem/libcc/mon/_wait.e b/lang/cem/libcc/mon/_wait.e
new file mode 100644 (file)
index 0000000..3ed01f0
--- /dev/null
@@ -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
diff --git a/lang/cem/libcc/mon/_write.e b/lang/cem/libcc/mon/_write.e
new file mode 100644 (file)
index 0000000..f83775d
--- /dev/null
@@ -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
index 099c95f..5f9ef4f 100644 (file)
@@ -1,5 +1,6 @@
 /* $Header$ */
 #include <sgtty.h>
-int gtty(fildes,argp) int fildes ; struct sgttyb *argp ; {
+int
+gtty(fildes,argp) int fildes ; struct sgttyb *argp ; {
        return ioctl(fildes,TIOCGETP,argp) ;
 }
index 749486c..8d12171 100644 (file)
@@ -1,5 +1,6 @@
 /* $Header$ */
 #include <sgtty.h>
-int stty(fildes,argp) int fildes ; struct sgttyb *argp ; {
+int
+stty(fildes,argp) int fildes ; struct sgttyb *argp ; {
        return ioctl(fildes,TIOCSETP,argp) ;
 }
index 9051af1..a76dab4 100644 (file)
@@ -1,7 +1,8 @@
 /* $Header$ */
 #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) ;