Initial revision
authorceriel <none@none>
Mon, 2 Feb 1987 10:25:38 +0000 (10:25 +0000)
committerceriel <none@none>
Mon, 2 Feb 1987 10:25:38 +0000 (10:25 +0000)
67 files changed:
lib/mantra/descr [new file with mode: 0644]
mach/mantra/libsys/LIST [new file with mode: 0644]
mach/mantra/libsys/Makefile [new file with mode: 0644]
mach/mantra/libsys/_exit.s [new file with mode: 0644]
mach/mantra/libsys/access.s [new file with mode: 0644]
mach/mantra/libsys/acct.s [new file with mode: 0644]
mach/mantra/libsys/alarm.s [new file with mode: 0644]
mach/mantra/libsys/brk.s [new file with mode: 0644]
mach/mantra/libsys/call.s [new file with mode: 0644]
mach/mantra/libsys/chdir.s [new file with mode: 0644]
mach/mantra/libsys/chmod.s [new file with mode: 0644]
mach/mantra/libsys/chown.s [new file with mode: 0644]
mach/mantra/libsys/chroot.s [new file with mode: 0644]
mach/mantra/libsys/cleanup.s [new file with mode: 0644]
mach/mantra/libsys/close.s [new file with mode: 0644]
mach/mantra/libsys/creat.s [new file with mode: 0644]
mach/mantra/libsys/dup.s [new file with mode: 0644]
mach/mantra/libsys/dup2.s [new file with mode: 0644]
mach/mantra/libsys/errno.s [new file with mode: 0644]
mach/mantra/libsys/execl.s [new file with mode: 0644]
mach/mantra/libsys/execle.s [new file with mode: 0644]
mach/mantra/libsys/execv.s [new file with mode: 0644]
mach/mantra/libsys/execve.s [new file with mode: 0644]
mach/mantra/libsys/exit.s [new file with mode: 0644]
mach/mantra/libsys/fcntl.s [new file with mode: 0644]
mach/mantra/libsys/fork.s [new file with mode: 0644]
mach/mantra/libsys/fstat.s [new file with mode: 0644]
mach/mantra/libsys/ftime.s [new file with mode: 0644]
mach/mantra/libsys/getegid.s [new file with mode: 0644]
mach/mantra/libsys/getgid.s [new file with mode: 0644]
mach/mantra/libsys/getpid.s [new file with mode: 0644]
mach/mantra/libsys/getuid.s [new file with mode: 0644]
mach/mantra/libsys/gtty.s [new file with mode: 0644]
mach/mantra/libsys/head_em.s [new file with mode: 0644]
mach/mantra/libsys/ioctl.s [new file with mode: 0644]
mach/mantra/libsys/kill.s [new file with mode: 0644]
mach/mantra/libsys/link.s [new file with mode: 0644]
mach/mantra/libsys/lockf.s [new file with mode: 0644]
mach/mantra/libsys/lseek.s [new file with mode: 0644]
mach/mantra/libsys/mknod.s [new file with mode: 0644]
mach/mantra/libsys/mount.s [new file with mode: 0644]
mach/mantra/libsys/msg.s [new file with mode: 0644]
mach/mantra/libsys/nice.s [new file with mode: 0644]
mach/mantra/libsys/open.s [new file with mode: 0644]
mach/mantra/libsys/pause.s [new file with mode: 0644]
mach/mantra/libsys/pipe.s [new file with mode: 0644]
mach/mantra/libsys/profil.s [new file with mode: 0644]
mach/mantra/libsys/ptrace.s [new file with mode: 0644]
mach/mantra/libsys/read.s [new file with mode: 0644]
mach/mantra/libsys/sem.s [new file with mode: 0644]
mach/mantra/libsys/setgid.s [new file with mode: 0644]
mach/mantra/libsys/setuid.s [new file with mode: 0644]
mach/mantra/libsys/shm.s [new file with mode: 0644]
mach/mantra/libsys/signal.s [new file with mode: 0644]
mach/mantra/libsys/stat.s [new file with mode: 0644]
mach/mantra/libsys/stime.s [new file with mode: 0644]
mach/mantra/libsys/stty.s [new file with mode: 0644]
mach/mantra/libsys/sync.s [new file with mode: 0644]
mach/mantra/libsys/syscall.s [new file with mode: 0644]
mach/mantra/libsys/time.s [new file with mode: 0644]
mach/mantra/libsys/times.s [new file with mode: 0644]
mach/mantra/libsys/umask.s [new file with mode: 0644]
mach/mantra/libsys/umount.s [new file with mode: 0644]
mach/mantra/libsys/unlink.s [new file with mode: 0644]
mach/mantra/libsys/utime.s [new file with mode: 0644]
mach/mantra/libsys/wait.s [new file with mode: 0644]
mach/mantra/libsys/write.s [new file with mode: 0644]

diff --git a/lib/mantra/descr b/lib/mantra/descr
new file mode 100644 (file)
index 0000000..e2cb2b2
--- /dev/null
@@ -0,0 +1,53 @@
+# $Revision$
+var w=4
+var p=4
+var s=2
+var l=4
+var f=4
+var d=8
+var NAME=mantra4
+var M=m68k4
+var LIB=lib/{M}/tail_
+var RT=lib/{M}/head_
+var CPP_F=-Dunix=unix -Dm68000=m68000
+var INCLUDES=-I{EM}/include/_tail_cc
+# 407 align is the default
+var ALIGN=-a0:2 -a1:2 -a2:2 -a3:2
+name be
+       from .m.g
+       to .s
+       program {EM}/lib/{M}/cg
+       args <
+       stdout
+       need .e
+end
+name as
+       from .s
+       to .o
+       program {EM}/lib/m68k2/as
+       args - -o > <
+       prep cond
+end
+name led
+       from .o.a
+       to .out
+       program {EM}/lib/em_led
+       mapflag -l* LNAME={EM}/{LIB}*
+       mapflag -i ALIGN=-a0:2 -a1:2 -a2:0x8000 -a3:2
+       mapflag -n ALIGN=-a0:2 -a1:2 -a2:0x8000 -a3:2
+       mapflag -nr ALIGN=-a0:2 -a1:0x8000 -a2:2 -a3:2
+       args (.e:{HEAD}=-b0:0x80000 {ALIGN} {EM}/{RT}em) \
+({RTS}:.b.c={EM}/{RT}cc) ({RTS}:.p={EM}/{RT}pc) -o > < \
+               (.p:{TAIL}={EM}/{LIB}pc) \
+               (.b:{TAIL}={EM}/{LIB}bc) \
+               (.b.c:{TAIL}={EM}/{LIB}cc.1s {EM}/{LIB}cc.2g) \
+               (.e:{TAIL}={EM}/{LIB}em {EM}/lib/mantra4/tail_mon {EM}/lib/{M}/end_em)
+       linker
+end
+name cv
+       from .out
+       to .cv
+       program {EM}/lib/mantra/cv
+       args < >
+       outfile a.out
+end
diff --git a/mach/mantra/libsys/LIST b/mach/mantra/libsys/LIST
new file mode 100644 (file)
index 0000000..1a21ff8
--- /dev/null
@@ -0,0 +1,64 @@
+libmon_s.a
+exit.s
+_exit.s
+access.s
+acct.s
+alarm.s
+chdir.s
+chmod.s
+chown.s
+chroot.s
+close.s
+creat.s
+dup.s
+dup2.s
+execl.s
+execle.s
+execv.s
+execve.s
+fcntl.s
+fork.s
+ftime.s
+getegid.s
+getgid.s
+getpid.s
+getuid.s
+stty.s
+gtty.s
+ioctl.s
+kill.s
+link.s
+lseek.s
+mknod.s
+mount.s
+nice.s
+open.s
+pause.s
+pipe.s
+profil.s
+ptrace.s
+read.s
+setgid.s
+setuid.s
+stat.s
+stime.s
+sync.s
+time.s
+times.s
+umask.s
+umount.s
+unlink.s
+utime.s
+write.s
+brk.s
+wait.s
+fstat.s
+signal.s
+shm.s
+sem.s
+msg.s
+lockf.s
+syscall.s
+call.s
+cleanup.s
+errno.s
diff --git a/mach/mantra/libsys/Makefile b/mach/mantra/libsys/Makefile
new file mode 100644 (file)
index 0000000..142afee
--- /dev/null
@@ -0,0 +1,29 @@
+# $Header$
+MACH=m68k4
+all:           libmon_o.a head_em.o
+
+install:       all
+               ../../install head_em.o head_em
+               ../../install libmon_o.a tail_mon
+
+
+cmp:           all
+               -../../compare head_em.o head_em
+               -../../compare libmon_o.a tail_mon
+
+libmon_o.a:    libmon_s.a
+               ASAR=aal ; export ASAR ;\
+               march . libmon_o.a
+
+head_em.o:     head_em.s
+               $(MACH) -I../../../h -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
diff --git a/mach/mantra/libsys/_exit.s b/mach/mantra/libsys/_exit.s
new file mode 100644 (file)
index 0000000..4fab73e
--- /dev/null
@@ -0,0 +1,10 @@
+.define __exit
+.extern __exit
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+__exit:                move.l #0x1,d0
+               move.l 4(sp),a0
+               trap #0
diff --git a/mach/mantra/libsys/access.s b/mach/mantra/libsys/access.s
new file mode 100644 (file)
index 0000000..7b5748e
--- /dev/null
@@ -0,0 +1,11 @@
+.define _access
+.extern _access
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_access:       move.l #0x21,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               jmp callc
diff --git a/mach/mantra/libsys/acct.s b/mach/mantra/libsys/acct.s
new file mode 100644 (file)
index 0000000..e04897c
--- /dev/null
@@ -0,0 +1,10 @@
+.define _acct
+.extern _acct
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_acct:         move.l #0x33,d0
+               move.l 4(sp),a0
+               jmp callc
diff --git a/mach/mantra/libsys/alarm.s b/mach/mantra/libsys/alarm.s
new file mode 100644 (file)
index 0000000..10680ee
--- /dev/null
@@ -0,0 +1,12 @@
+.define _alarm
+.extern _alarm
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_alarm:
+               move.l 4(sp),a0
+               move.l #0x1B,d0
+               trap #0
+               rts
diff --git a/mach/mantra/libsys/brk.s b/mach/mantra/libsys/brk.s
new file mode 100644 (file)
index 0000000..fb5b428
--- /dev/null
@@ -0,0 +1,27 @@
+.define _brk
+.define _sbrk
+.extern _brk
+.extern _sbrk
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_sbrk:         move.l .reghp,a0
+               add.l  4(sp),a0
+               move.l #0x11,d0
+               trap #0
+               bcs lcerror
+               move.l .reghp,d0
+               move.l d0,a0
+               add.l  4(sp),a0
+               move.l a0,.reghp
+               rts
+lcerror:       jmp cerror
+_brk:          move.l #0x11,d0
+               move.l 4(sp),a0
+               trap #0
+               bcs lcerror
+               move.l 4(sp),.reghp
+               clr.l d0
+               rts
diff --git a/mach/mantra/libsys/call.s b/mach/mantra/libsys/call.s
new file mode 100644 (file)
index 0000000..de682c1
--- /dev/null
@@ -0,0 +1,28 @@
+.define call
+.define callc
+.define calle
+.define cerror
+.extern call
+.extern callc
+.extern calle
+.extern cerror
+.extern _errno
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+call:          trap #0
+               bcs cerror
+               rts
+callc:
+               trap #0
+               bcs cerror
+               clr.l d0
+               rts
+calle:
+               trap #0
+cerror:
+               move.l d0,_errno
+               move.l #-1,d0
+               rts
diff --git a/mach/mantra/libsys/chdir.s b/mach/mantra/libsys/chdir.s
new file mode 100644 (file)
index 0000000..2ba6798
--- /dev/null
@@ -0,0 +1,10 @@
+.define _chdir
+.extern _chdir
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_chdir:                move.l #0xC,d0
+               move.l 4(sp),a0
+               jmp callc
diff --git a/mach/mantra/libsys/chmod.s b/mach/mantra/libsys/chmod.s
new file mode 100644 (file)
index 0000000..b51cca5
--- /dev/null
@@ -0,0 +1,11 @@
+.define _chmod
+.extern _chmod
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_chmod:                move.l #0xF,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               jmp callc
diff --git a/mach/mantra/libsys/chown.s b/mach/mantra/libsys/chown.s
new file mode 100644 (file)
index 0000000..8efe31c
--- /dev/null
@@ -0,0 +1,12 @@
+.define _chown
+.extern _chown
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_chown:                move.l #0x10,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               move.l 12(sp),a1
+               jmp callc
diff --git a/mach/mantra/libsys/chroot.s b/mach/mantra/libsys/chroot.s
new file mode 100644 (file)
index 0000000..b410e4a
--- /dev/null
@@ -0,0 +1,10 @@
+.define _chroot
+.extern _chroot
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_chroot:       move.l #0x3D,d0
+               move.l 4(sp),a0
+               jmp callc
diff --git a/mach/mantra/libsys/cleanup.s b/mach/mantra/libsys/cleanup.s
new file mode 100644 (file)
index 0000000..825d816
--- /dev/null
@@ -0,0 +1,9 @@
+.define __cleanup
+.extern __cleanup
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+__cleanup:
+rts
diff --git a/mach/mantra/libsys/close.s b/mach/mantra/libsys/close.s
new file mode 100644 (file)
index 0000000..46519fe
--- /dev/null
@@ -0,0 +1,10 @@
+.define _close
+.extern _close
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_close:                move.l #0x6,d0
+               move.l 4(sp),a0
+               jmp callc
diff --git a/mach/mantra/libsys/creat.s b/mach/mantra/libsys/creat.s
new file mode 100644 (file)
index 0000000..1372f68
--- /dev/null
@@ -0,0 +1,11 @@
+.define _creat
+.extern _creat
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_creat:                move.l #0x8,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               jmp call
diff --git a/mach/mantra/libsys/dup.s b/mach/mantra/libsys/dup.s
new file mode 100644 (file)
index 0000000..e2ec3fe
--- /dev/null
@@ -0,0 +1,10 @@
+.define _dup
+.extern _dup
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_dup:          move.l #0x29,d0
+               move.l 4(sp),a0
+               jmp call
diff --git a/mach/mantra/libsys/dup2.s b/mach/mantra/libsys/dup2.s
new file mode 100644 (file)
index 0000000..2286c5b
--- /dev/null
@@ -0,0 +1,17 @@
+.define _dup2
+.extern _dup2
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_dup2:
+tst.b -40(sp)
+link   a6,#-0
+move.l 12(a6),-(sp)
+move.l #0,-(sp)
+move.l 8(a6),-(sp)
+jsr _fcntl
+add.l #12,sp
+unlk a6
+rts
diff --git a/mach/mantra/libsys/errno.s b/mach/mantra/libsys/errno.s
new file mode 100644 (file)
index 0000000..adc0830
--- /dev/null
@@ -0,0 +1,9 @@
+.define _errno
+.extern _errno
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .bss
+_errno:                .space 4
+.sect .text
diff --git a/mach/mantra/libsys/execl.s b/mach/mantra/libsys/execl.s
new file mode 100644 (file)
index 0000000..ec07bff
--- /dev/null
@@ -0,0 +1,16 @@
+.define _execl
+.extern _execl
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_execl:                link a6,#0
+               tst.b -132(sp)
+               move.l _environ,-(sp)
+               pea 12(a6)
+               move.l 8(a6),-(sp)
+               jsr _execve
+               add.l #0xC,sp
+               unlk a6
+               rts
diff --git a/mach/mantra/libsys/execle.s b/mach/mantra/libsys/execle.s
new file mode 100644 (file)
index 0000000..0bae3ed
--- /dev/null
@@ -0,0 +1,20 @@
+.define _execle
+.extern _execle
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_execle:       link a6,#0
+               tst.b -48(sp)
+               lea 12(a6),a0
+1:
+               tst.l (a0)+
+               bne 1b
+               move.l a0,-(sp)
+               pea 12(a6)
+               move.l 8(a6),-(sp)
+               jsr _execve
+               add.l #0xC,sp
+               unlk a6
+               rts
diff --git a/mach/mantra/libsys/execv.s b/mach/mantra/libsys/execv.s
new file mode 100644 (file)
index 0000000..e8bb105
--- /dev/null
@@ -0,0 +1,16 @@
+.define _execv
+.extern _execv
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_execv:                link a6,#0
+               tst.b -48(sp)
+               move.l _environ,-(sp)
+               move.l 12(a6),-(sp)
+               move.l 8(a6),-(sp)
+               jsr _execve
+               add.l #0xC,sp
+               unlk a6
+               rts
diff --git a/mach/mantra/libsys/execve.s b/mach/mantra/libsys/execve.s
new file mode 100644 (file)
index 0000000..f7894f6
--- /dev/null
@@ -0,0 +1,12 @@
+.define _execve
+.extern _execve
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_execve:       move.l #0x3B,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               move.l 12(sp),a1
+               jmp calle
diff --git a/mach/mantra/libsys/exit.s b/mach/mantra/libsys/exit.s
new file mode 100644 (file)
index 0000000..33e3d65
--- /dev/null
@@ -0,0 +1,16 @@
+.define _exit
+.extern _exit
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_exit:
+tst.b -40(sp)
+link   a6,#-0
+jsr __cleanup
+move.l 8(a6),-(sp)
+jsr __exit
+add.l #4,sp
+unlk a6
+rts
diff --git a/mach/mantra/libsys/fcntl.s b/mach/mantra/libsys/fcntl.s
new file mode 100644 (file)
index 0000000..221f286
--- /dev/null
@@ -0,0 +1,12 @@
+.define _fcntl
+.extern _fcntl
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_fcntl:                move.l #0x3E,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               move.l 12(sp),a1
+               jmp callc
diff --git a/mach/mantra/libsys/fork.s b/mach/mantra/libsys/fork.s
new file mode 100644 (file)
index 0000000..0ccd4fb
--- /dev/null
@@ -0,0 +1,17 @@
+.define _fork
+.extern _fork
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_fork:         move.l #0x2,d0
+               trap #0
+               bra 1f
+               bcc 2f
+               jmp cerror
+1:
+               !move.l d0,p_uid
+               clr.l d0
+2:
+               rts
diff --git a/mach/mantra/libsys/fstat.s b/mach/mantra/libsys/fstat.s
new file mode 100644 (file)
index 0000000..dd8fdc8
--- /dev/null
@@ -0,0 +1,11 @@
+.define _fstat
+.extern _fstat
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_fstat:                move.l  #0x1C,d0
+               move.l  4(sp),a0
+               move.l  8(sp),d1
+               jmp callc
diff --git a/mach/mantra/libsys/ftime.s b/mach/mantra/libsys/ftime.s
new file mode 100644 (file)
index 0000000..297a4f8
--- /dev/null
@@ -0,0 +1,10 @@
+.define _ftime
+.extern _ftime
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_ftime:                move.l #0x23,d0
+               move.l 4(sp),a0
+               jmp callc
diff --git a/mach/mantra/libsys/getegid.s b/mach/mantra/libsys/getegid.s
new file mode 100644 (file)
index 0000000..470f8b3
--- /dev/null
@@ -0,0 +1,11 @@
+.define _getegid
+.extern _getegid
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_getegid:      move.l #0x2F,d0
+               trap #0
+               move.l d1,d0
+               rts
diff --git a/mach/mantra/libsys/getgid.s b/mach/mantra/libsys/getgid.s
new file mode 100644 (file)
index 0000000..ff4dd2c
--- /dev/null
@@ -0,0 +1,10 @@
+.define _getgid
+.extern _getgid
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_getgid:       move.l #0x2F,d0
+               trap #0
+               rts
diff --git a/mach/mantra/libsys/getpid.s b/mach/mantra/libsys/getpid.s
new file mode 100644 (file)
index 0000000..3d128e4
--- /dev/null
@@ -0,0 +1,10 @@
+.define _getpid
+.extern _getpid
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_getpid:       move.l #0x14,d0
+               trap #0
+               rts
diff --git a/mach/mantra/libsys/getuid.s b/mach/mantra/libsys/getuid.s
new file mode 100644 (file)
index 0000000..7c884c6
--- /dev/null
@@ -0,0 +1,10 @@
+.define _getuid
+.extern _getuid
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_getuid:       move.l #0x18,d0
+               trap #0
+               rts
diff --git a/mach/mantra/libsys/gtty.s b/mach/mantra/libsys/gtty.s
new file mode 100644 (file)
index 0000000..8b90d86
--- /dev/null
@@ -0,0 +1,17 @@
+.define _gtty
+.extern _gtty
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_gtty:
+tst.b -40(sp)
+link   a6,#-0
+move.l 12(a6),-(sp)
+move.l #29704,-(sp)
+move.l 8(a6),-(sp)
+jsr _ioctl
+add.l #12,sp
+unlk a6
+rts
diff --git a/mach/mantra/libsys/head_em.s b/mach/mantra/libsys/head_em.s
new file mode 100644 (file)
index 0000000..d8ce66d
--- /dev/null
@@ -0,0 +1,76 @@
+.define .lino,.filn
+.define EXIT
+.define        begtext,begdata,begbss
+.define        EARRAY,ERANGE,ESET,EIDIVZ,EHEAP,EILLINS,ECASE,EBADGTO
+.define        hol0,.reghp,.limhp,.trpim,.trppc
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+
+
+
+! EM runtime start-off for the Bleasdale 68000 system
+
+
+LINO_AD        = 0
+FILN_AD        = 4
+
+EARRAY = 0
+ERANGE = 1
+ESET   = 2
+EIDIVZ = 6
+EHEAP  = 17
+EILLINS        = 18
+ECASE  = 20
+EBADGTO = 27
+
+       .sect .text
+begtext:
+       ! Bleasdale puts the argument and environment vectors
+       ! themselves on top of the stack, instead of POINTERS
+       ! to these vectors. We get things right here.
+       move.l  4(sp),a0
+       clr.l   -4(a0)
+       move.l  sp,a0
+       sub.l   #8,sp
+       move.l  (a0),(sp)
+       add.l   #4,a0
+       move.l  a0,4(sp)
+1:
+       tst.l   (a0)+
+       bne     1b
+       move.l  4(sp),a1
+       cmp.l   (a1),a0
+       blt     2f
+       sub.l   #4,a0
+2:
+       move.l  a0,8(sp)
+
+       ! Now the stack contains an argc (4 bytes), argv-pointer and
+       ! envp pointer.
+
+       jsr     _m_a_i_n
+       add     #012,sp
+EXIT:
+       jsr     __exit
+
+       .sect .data
+begdata:
+hol0:
+.lino:
+       .data4  0       ! lino
+.filn:
+       .data4  0       ! filn
+.reghp:
+       .data4  endbss
+.limhp:
+       .data4  endbss
+.trppc:
+       .data4  0
+.trpim:
+       .data4  0
+
+
+       .sect .bss
+begbss: !initialization is not needed because ALL entries are in zero space!
diff --git a/mach/mantra/libsys/ioctl.s b/mach/mantra/libsys/ioctl.s
new file mode 100644 (file)
index 0000000..62dbd87
--- /dev/null
@@ -0,0 +1,12 @@
+.define _ioctl
+.extern _ioctl
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_ioctl:                move.l #0x36,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               move.l 12(sp),a1
+               jmp callc
diff --git a/mach/mantra/libsys/kill.s b/mach/mantra/libsys/kill.s
new file mode 100644 (file)
index 0000000..1af2ec1
--- /dev/null
@@ -0,0 +1,11 @@
+.define _kill
+.extern _kill
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_kill:         move.l #0x25,d0
+               move.l 4(sp),a0
+               move.l 6(sp),d1
+               jmp callc
diff --git a/mach/mantra/libsys/link.s b/mach/mantra/libsys/link.s
new file mode 100644 (file)
index 0000000..97e46e4
--- /dev/null
@@ -0,0 +1,11 @@
+.define _link
+.extern _link
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_link:         move.l #0x9,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               jmp callc
diff --git a/mach/mantra/libsys/lockf.s b/mach/mantra/libsys/lockf.s
new file mode 100644 (file)
index 0000000..369e17e
--- /dev/null
@@ -0,0 +1,12 @@
+.define _lockf
+.extern _lockf
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_lockf:                move.l #0x38,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               move.l 12(sp),a1
+               jmp callc
diff --git a/mach/mantra/libsys/lseek.s b/mach/mantra/libsys/lseek.s
new file mode 100644 (file)
index 0000000..a992c68
--- /dev/null
@@ -0,0 +1,12 @@
+.define _lseek
+.extern _lseek
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_lseek:                move.l #0x13,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               move.l 12(sp),a1
+               jmp call
diff --git a/mach/mantra/libsys/mknod.s b/mach/mantra/libsys/mknod.s
new file mode 100644 (file)
index 0000000..5df7652
--- /dev/null
@@ -0,0 +1,12 @@
+.define _mknod
+.extern _mknod
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_mknod:                move.l #0xE,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               move.l 12(sp),a1
+               jmp callc
diff --git a/mach/mantra/libsys/mount.s b/mach/mantra/libsys/mount.s
new file mode 100644 (file)
index 0000000..85d3c37
--- /dev/null
@@ -0,0 +1,12 @@
+.define _mount
+.extern _mount
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_mount:                move.l #0x15,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               move.l 12(sp),a1
+               jmp callc
diff --git a/mach/mantra/libsys/msg.s b/mach/mantra/libsys/msg.s
new file mode 100644 (file)
index 0000000..0fabafd
--- /dev/null
@@ -0,0 +1,62 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _msgsnd
+.define _msgctl
+.define _msgrcv
+.define _msgget
+msg = 49
+.extern        _msgrcv
+.extern        _msgctl
+.extern        _msgsnd
+.extern        _msgget
+.extern        _syscall
+
+_msgget:
+       link    a6,#0
+       tst.b   -32(sp)
+       move.l  12(a6),-(sp)
+       move.l  8(a6),-(sp)
+       clr.l   -(sp)
+       move.l  #msg,-(sp)
+       jsr     _syscall
+       add     #0x10,sp
+       unlk    a6
+       rts
+_msgctl:
+       link    a6,#0
+       tst.b   -32(sp)
+       move.l  16(a6),-(sp)
+       move.l  12(a6),-(sp)
+       move.l  8(a6),-(sp)
+       move.l  #1,-(sp)
+       move.l  #msg,-(sp)
+       jsr     _syscall
+       add     #0x14,sp
+       unlk    a6
+       rts
+_msgrcv:
+       link    a6,#0
+       tst.b   -32(sp)
+       move.l  24(a6),-(sp)
+       move.l  20(a6),-(sp)
+       move.l  16(a6),-(sp)
+       move.l  12(a6),-(sp)
+       move.l  8(a6),-(sp)
+       move.l  #2,-(sp)
+       move.l  #msg,-(sp)
+       jsr     _syscall
+       add     #0x1C,sp
+       unlk    a6
+       rts
+_msgsnd:
+       link    a6,#0
+       tst.b   -32(sp)
+       move.l  20(a6),-(sp)
+       move.l  16(a6),-(sp)
+       move.l  12(a6),-(sp)
+       move.l  8(a6),-(sp)
+       move.l  #3,-(sp)
+       move.l  #msg,-(sp)
+       jsr     _syscall
+       add     #0x18,sp
+       unlk    a6
+       rts
diff --git a/mach/mantra/libsys/nice.s b/mach/mantra/libsys/nice.s
new file mode 100644 (file)
index 0000000..1e12910
--- /dev/null
@@ -0,0 +1,10 @@
+.define _nice
+.extern _nice
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_nice:         move.l #0x22,d0
+               move.l 4(sp),a0
+               jmp callc
diff --git a/mach/mantra/libsys/open.s b/mach/mantra/libsys/open.s
new file mode 100644 (file)
index 0000000..5626505
--- /dev/null
@@ -0,0 +1,11 @@
+.define _open
+.extern _open
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_open:         move.l #0x5,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               jmp call
diff --git a/mach/mantra/libsys/pause.s b/mach/mantra/libsys/pause.s
new file mode 100644 (file)
index 0000000..fb777eb
--- /dev/null
@@ -0,0 +1,10 @@
+.define _pause
+.extern _pause
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_pause:                move.l #0x1D,d0
+               trap #0
+               rts
diff --git a/mach/mantra/libsys/pipe.s b/mach/mantra/libsys/pipe.s
new file mode 100644 (file)
index 0000000..96c8cb2
--- /dev/null
@@ -0,0 +1,18 @@
+.define _pipe
+.extern _pipe
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_pipe:         
+               move.l #0x2A,d0
+               trap #0
+               bcc 1f
+               jmp cerror
+1:
+               move.l 4(sp),a0
+               move.l d0,(a0)+
+               move.l d1,(a0)
+               clr.l d0
+               rts
diff --git a/mach/mantra/libsys/profil.s b/mach/mantra/libsys/profil.s
new file mode 100644 (file)
index 0000000..dc27f5d
--- /dev/null
@@ -0,0 +1,14 @@
+.define _profil
+.extern _profil
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_profil:       move.l #0x2C,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               move.l 12(sp),a1
+               move.l 16(sp),d2
+               trap #0
+               rts
diff --git a/mach/mantra/libsys/ptrace.s b/mach/mantra/libsys/ptrace.s
new file mode 100644 (file)
index 0000000..70b0b67
--- /dev/null
@@ -0,0 +1,16 @@
+.define _ptrace
+.extern _ptrace
+.extern _errno
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_ptrace:       move.l #0x1A,d0
+               move.l 16(sp),a0
+               move.l 12(sp),d1
+               move.l 8(sp),a1
+               move.l 4(sp),d2
+               clr.l  _errno
+               trap #0
+               rts
diff --git a/mach/mantra/libsys/read.s b/mach/mantra/libsys/read.s
new file mode 100644 (file)
index 0000000..cc02d5f
--- /dev/null
@@ -0,0 +1,12 @@
+.define _read
+.extern _read
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_read:         move.l #0x3,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               move.l 12(sp),a1
+               jmp call
diff --git a/mach/mantra/libsys/sem.s b/mach/mantra/libsys/sem.s
new file mode 100644 (file)
index 0000000..a318959
--- /dev/null
@@ -0,0 +1,47 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _semctl
+.define _semop
+.define _semget
+sem = 53
+.extern        _semop
+.extern        _semctl
+.extern        _semget
+.extern        _syscall
+
+_semctl:
+       link    a6,#0
+       tst.b   -32(sp)
+       move.l  20(a6),-(sp)
+       move.l  16(a6),-(sp)
+       move.l  12(a6),-(sp)
+       move.l  8(a6),-(sp)
+       clr.l   -(sp)
+       move.l  #sem,-(sp)
+       jsr     _syscall
+       add     #0x18,sp
+       unlk    a6
+       rts
+_semget:
+       link    a6,#0
+       tst.b   -32(sp)
+       move.l  16(a6),-(sp)
+       move.l  12(a6),-(sp)
+       move.l  8(a6),-(sp)
+       move.l  #1,-(sp)
+       move.l  #sem,-(sp)
+       jsr     _syscall
+       add     #0x14,sp
+       unlk    a6
+       rts
+_semop:
+       link    a6,#0
+       tst.b   -32(sp)
+       move.l  16(a6),-(sp)
+       move.l  12(a6),-(sp)
+       move.l  8(a6),-(sp)
+       move.l  #2,-(sp)
+       move.l  #sem,-(sp)
+       jsr     _syscall
+       add     #0x14,sp
+       unlk    a6
+       rts
diff --git a/mach/mantra/libsys/setgid.s b/mach/mantra/libsys/setgid.s
new file mode 100644 (file)
index 0000000..fb26537
--- /dev/null
@@ -0,0 +1,10 @@
+.define _setgid
+.extern _setgid
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_setgid:       move.l #0x2E,d0
+               move.l 4(sp),a0
+               jmp callc
diff --git a/mach/mantra/libsys/setuid.s b/mach/mantra/libsys/setuid.s
new file mode 100644 (file)
index 0000000..ee8f5c1
--- /dev/null
@@ -0,0 +1,10 @@
+.define _setuid
+.extern _setuid
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_setuid:       move.l #0x17,d0
+               move.l 4(sp),a0
+               jmp callc
diff --git a/mach/mantra/libsys/shm.s b/mach/mantra/libsys/shm.s
new file mode 100644 (file)
index 0000000..73899e2
--- /dev/null
@@ -0,0 +1,58 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define _shmdt
+.define _shmat
+.define _shmctl
+.define _shmget
+shm = 52
+.extern        _shmdt
+.extern        _shmat
+.extern        _shmctl
+.extern        _shmget
+.extern        _syscall
+
+_shmat:
+       link    a6,#0
+       tst.b   -32(sp)
+       move.l  16(a6),-(sp)
+       move.l  12(a6),-(sp)
+       move.l  8(a6),-(sp)
+       clr.l   -(sp)
+       move.l  #shm,-(sp)
+       jsr     _syscall
+       add     #0x14,sp
+       unlk    a6
+       rts
+_shmctl:
+       link    a6,#0
+       tst.b   -32(sp)
+       move.l  16(a6),-(sp)
+       move.l  12(a6),-(sp)
+       move.l  8(a6),-(sp)
+       move.l  #1,-(sp)
+       move.l  #shm,-(sp)
+       jsr     _syscall
+       add     #0x14,sp
+       unlk    a6
+       rts
+_shmdt:
+       link    a6,#0
+       tst.b   -144(sp)
+       move.l  8(a6),-(sp)
+       move.l  #2,-(sp)
+       move.l  #shm,-(sp)
+       jsr     _syscall
+       add     #0xC,sp
+       unlk    a6
+       rts
+_shmget:
+       link    a6,#0
+       tst.b   -32(sp)
+       move.l  16(a6),-(sp)
+       move.l  12(a6),-(sp)
+       move.l  8(a6),-(sp)
+       move.l  #3,-(sp)
+       move.l  #shm,-(sp)
+       jsr     _syscall
+       add     #0x14,sp
+       unlk    a6
+       rts
diff --git a/mach/mantra/libsys/signal.s b/mach/mantra/libsys/signal.s
new file mode 100644 (file)
index 0000000..fc8ddeb
--- /dev/null
@@ -0,0 +1,91 @@
+.define _signal
+.extern _signal
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+NSIG=32
+_signal:
+       move.l  4(sp), d0
+       cmp.l   #NSIG,d0
+       bcc     1f
+       move.l  8(sp),d1
+       move.l  d0,a0
+       add.l   a0,a0
+       add.l   a0,a0
+       add.l   #dvect,a0
+       move.l  (a0),a1
+       move.l  d1,(a0)
+       beq     2f
+       btst    #0,d1
+       bne     2f
+       move.l  #jmptab,d1
+       add.l   d0,d1
+       add.l   d0,d1
+2:
+       move.l  d0,a0
+       move.l  #0x30,d0
+       trap    #0
+       bcs     3f
+       btst    #0,d0
+       bne     4f
+       move.l  a1,d0
+4:
+       clr.l   d1
+       rts
+1:
+       move.l  #22,d0
+3:
+       jmp     cerror
+
+jmptab:        bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+       bsr     enter
+enter:
+       movem.l d0/d1/a0/a1,-(sp)
+       move.l  16(sp),d0
+       sub.l   #jmptab+2,d0
+       asr.l   #1,d0
+       move.l  d0,-(sp)
+       move.l  d0,a0
+       add.l   a0,a0
+       add.l   a0,a0
+       add.l   #dvect,a0
+       move.l  (a0),a0
+       jsr     (a0)
+       add.l   #4,sp
+       movem.l (sp)+,d0/d1/a0/a1
+       add.l   #4,sp
+       rtr
+.sect .bss
+dvect: .space 4*NSIG
diff --git a/mach/mantra/libsys/stat.s b/mach/mantra/libsys/stat.s
new file mode 100644 (file)
index 0000000..461767b
--- /dev/null
@@ -0,0 +1,11 @@
+.define _stat
+.extern _stat
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_stat:         move.l #0x12,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               jmp callc
diff --git a/mach/mantra/libsys/stime.s b/mach/mantra/libsys/stime.s
new file mode 100644 (file)
index 0000000..4651431
--- /dev/null
@@ -0,0 +1,15 @@
+.define _stime
+.extern _stime
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_stime:                move.l #0x19,d0
+               move.l 4(sp),a0
+               move.l (a0),a0
+               trap #0
+               bcs 1f
+               rts
+1:
+               jmp cerror
diff --git a/mach/mantra/libsys/stty.s b/mach/mantra/libsys/stty.s
new file mode 100644 (file)
index 0000000..0de8f97
--- /dev/null
@@ -0,0 +1,17 @@
+.define _stty
+.extern _stty
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_stty:
+tst.b -40(sp)
+link   a6,#-0
+move.l 12(a6),-(sp)
+move.l #29705,-(sp)
+move.l 8(a6),-(sp)
+jsr _ioctl
+add.l #12,sp
+unlk a6
+rts
diff --git a/mach/mantra/libsys/sync.s b/mach/mantra/libsys/sync.s
new file mode 100644 (file)
index 0000000..3ee77a2
--- /dev/null
@@ -0,0 +1,10 @@
+.define _sync
+.extern _sync
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_sync:         move.l #0x24,d0
+               trap #0
+               rts
diff --git a/mach/mantra/libsys/syscall.s b/mach/mantra/libsys/syscall.s
new file mode 100644 (file)
index 0000000..6230775
--- /dev/null
@@ -0,0 +1,26 @@
+.define _syscall
+.extern _syscall
+.extern        cerror
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_syscall:
+               move.l 4(sp),d0
+               move.l 8(sp),a0
+               move.l 12(sp),d1
+               move.l 16(sp),a1
+               movem.l d2/d3/a2,sv
+               move.l  20(sp),d2
+               move.l  24(sp),a2
+               move.l  28(sp),d3
+               trap    #0
+               movem.l sv,d2/d3/a2
+               bcs     1f
+               rts
+       1:
+               jmp     cerror
+
+.sect .bss
+sv: .space 12
diff --git a/mach/mantra/libsys/time.s b/mach/mantra/libsys/time.s
new file mode 100644 (file)
index 0000000..e7551c0
--- /dev/null
@@ -0,0 +1,15 @@
+.define _time
+.extern _time
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_time:         move.l #0xD,d0
+               trap #0
+               tst.l 4(sp)
+               beq 1f
+               move.l 4(sp),a0
+               move.l d0,(a0)
+1:
+               rts
diff --git a/mach/mantra/libsys/times.s b/mach/mantra/libsys/times.s
new file mode 100644 (file)
index 0000000..8ed1e1b
--- /dev/null
@@ -0,0 +1,11 @@
+.define _times
+.extern _times
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_times:                move.l #0x2B,d0
+               move.l 4(sp),a0
+               trap #0
+               rts
diff --git a/mach/mantra/libsys/umask.s b/mach/mantra/libsys/umask.s
new file mode 100644 (file)
index 0000000..60d22cc
--- /dev/null
@@ -0,0 +1,10 @@
+.define _umask
+.extern _umask
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_umask:                move.l #0x3C,d0
+               move.l 4(sp),a0
+               jmp call
diff --git a/mach/mantra/libsys/umount.s b/mach/mantra/libsys/umount.s
new file mode 100644 (file)
index 0000000..4adcab5
--- /dev/null
@@ -0,0 +1,10 @@
+.define _umount
+.extern _umount
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_umount:       move.l #0x16,d0
+               move.l 4(sp),a0
+               jmp callc
diff --git a/mach/mantra/libsys/unlink.s b/mach/mantra/libsys/unlink.s
new file mode 100644 (file)
index 0000000..5d791d5
--- /dev/null
@@ -0,0 +1,10 @@
+.define _unlink
+.extern _unlink
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_unlink:       move.l #0xA,d0
+               move.l 4(sp),a0
+               jmp callc
diff --git a/mach/mantra/libsys/utime.s b/mach/mantra/libsys/utime.s
new file mode 100644 (file)
index 0000000..48c18e6
--- /dev/null
@@ -0,0 +1,11 @@
+.define _utime
+.extern _utime
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_utime:                move.l #0x1E,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               jmp callc
diff --git a/mach/mantra/libsys/wait.s b/mach/mantra/libsys/wait.s
new file mode 100644 (file)
index 0000000..8bb649b
--- /dev/null
@@ -0,0 +1,17 @@
+.define _wait
+.extern _wait
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_wait:         move.l  #0x7,d0
+               move.l  4(sp),a0
+               trap #0
+               bcs cerror
+               tst.l 4(sp)
+               beq 1f
+               move.l 4(sp),a0
+               move.l d1,(a0)
+1:
+               rts
diff --git a/mach/mantra/libsys/write.s b/mach/mantra/libsys/write.s
new file mode 100644 (file)
index 0000000..c3888a6
--- /dev/null
@@ -0,0 +1,12 @@
+.define _write
+.extern _write
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+_write:                move.l #0x4,d0
+               move.l 4(sp),a0
+               move.l 8(sp),d1
+               move.l 12(sp),a1
+               jmp call