--- /dev/null
+# $Header$
+all: head_em.o libmon_o.a
+
+install: cp
+
+cp: 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
+
+
+head_em.o: head_em.s
+ vax4 -I../../../h -c head_em.s
+
+libmon_o.a: libmon_s.a
+ ASAR=ar ; export ASAR ;\
+ RANLIB=ranlib ; export RANLIB ;\
+ march . libmon_o.a
+
+clean:
+ rm -f *.o libmon_o.a
+
+opr:
+ make pr | opr
+
+pr:
+ @pr `pwd`/Makefile `pwd`/head_em.s
+ @arch pv libmon_s.a | pr -h `pwd`/libmon_s.a
--- /dev/null
+.set exit,1
+.globl __exit
+
+__exit:
+ .word 0x0000
+ chmk $exit
+ halt
--- /dev/null
+.set access,33
+.globl _access
+.globl cerror
+
+_access:
+ .word 0x0000
+ chmk $access
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set acct,51
+.globl _acct
+.globl cerror
+
+_acct:
+ .word 0x0000
+ chmk $acct
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set alarm,27
+.globl _alarm
+
+_alarm:
+ .word 0x0000
+ chmk $alarm
+ ret
--- /dev/null
+.globl cerror
+.globl _errno
+
+.data
+_errno: .long 0
+
+.text
+cerror:
+ movl r0,_errno
+ mnegl $1,r0
+ ret
--- /dev/null
+.set chdir,12
+.globl _chdir
+.globl cerror
+
+_chdir:
+ .word 0x0000
+ chmk $chdir
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set chmod,15
+.globl _chmod
+.globl cerror
+
+_chmod:
+ .word 0x0000
+ chmk $chmod
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set chown,16
+.globl _chown
+.globl cerror
+
+_chown:
+ .word 0x0000
+ chmk $chown
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set chroot,61
+.globl _chroot
+.globl cerror
+
+_chroot:
+ .word 0x0000
+ chmk $chroot
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+_cleanup() { }
--- /dev/null
+.set close,6
+.globl _close
+.globl cerror
+
+_close:
+ .word 0x0000
+ chmk $close
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+if vax4 -O -c -I../../../h -I. $1 1>&2
+then echo `basename $1 $2`.o
+else exit 1
+fi
--- /dev/null
+.set creat,8
+.globl _creat
+.globl cerror
+
+_creat:
+ .word 0x0000
+ chmk $creat
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set dup,41
+.globl _dup
+.globl cerror
+
+_dup:
+ .word 0x0000
+ chmk $dup
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+int
+dup2(oldfd, newfd)
+{
+ close(newfd);
+ return fcntl(oldfd, 0, newfd);
+}
--- /dev/null
+.globl _execl
+.globl _execv
+
+_execl:
+ .word 0x0000
+ pushab 8(ap)
+ pushl 4(ap)
+ calls $2,_execv
+ ret
--- /dev/null
+.globl _execle
+.globl _execve
+
+_execle:
+ .word 0x0000
+ movl (ap),r0
+ pushl (ap)[r0]
+ pushab 8(ap)
+ pushl 4(ap)
+ calls $3,_execve
+ ret
--- /dev/null
+.globl _execv
+.globl _execve
+.globl _environ
+
+_execv:
+ .word 0x0000
+ pushl _environ
+ pushl 8(ap)
+ pushl 4(ap)
+ calls $3,_execve
+ ret
--- /dev/null
+.set exece,59
+.globl _execve
+.globl cerror
+
+_execve:
+ .word 0x0000
+ chmk $exece
+ jmp cerror
--- /dev/null
+exit(n) { _cleanup(); _exit(n); }
--- /dev/null
+.set fcntl,62
+.globl _fcntl
+.globl cerror
+
+_fcntl:
+ .word 0x0000
+ chmk $fcntl
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set fork,2
+.globl _fork
+.globl cerror
+
+_fork:
+ .word 0x0000
+ chmk $fork
+ bcc ok
+ jmp cerror
+ok:
+ blbc r1,out
+ clrl r0
+out:
+ ret
--- /dev/null
+.set fstat,28
+.globl _fstat
+.globl cerror
+
+_fstat:
+ .word 0x0000
+ chmk $fstat
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set getgid,47
+.globl _getegid
+
+_getegid:
+ .word 0x0000
+ chmk $getgid
+ movl r1,r0
+ ret
--- /dev/null
+.set getuid,24
+.globl _geteuid
+
+_geteuid:
+ .word 0x0000
+ chmk $getuid
+ movl r1,r0
+ ret
--- /dev/null
+.set getgid,47
+.globl _getgid
+
+_getgid:
+ .word 0x0000
+ chmk $getgid
+ ret
--- /dev/null
+.set getpid,20
+.globl _getpid
+
+_getpid:
+ .word 0x0000
+ chmk $getpid
+ ret
--- /dev/null
+.set getpid,20
+.globl _getppid
+
+_getppid:
+ .word 0x0000
+ chmk $getpid
+ movl r1,r0
+ ret
--- /dev/null
+.set getuid,24
+.globl _getuid
+
+_getuid:
+ .word 0x0000
+ chmk $getuid
+ ret
--- /dev/null
+.set gtty,32
+.globl _gtty
+.globl cerror
+
+_gtty:
+ .word 0x0000
+ chmk $gtty
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+#include "em_abs.h"
+
+ # $Header$
+
+.globl hol0
+.globl .reghp
+.globl .trppc
+.globl .trpim
+
+ # run time startoff
+ .word 0
+ bispsw $0100 # set FU(0100)
+ movl 4(sp),r0
+ clrl -4(r0)
+ movl sp,r0
+ movl (r0)+,r1
+ movl r0,r2
+a1:
+ tstl (r0)+
+ bneq a1
+ cmpl r0,(r2)
+ blssu a2
+ tstl -(r0)
+a2:
+ pushl r0
+ pushl r2
+ pushl r1
+ movl $m1,ap
+ chmk (ap)+ # catch floating point exception
+ calls $3,_m_a_i_n
+ movl $m2,ap
+ movl r0,6(ap)
+ chmk (ap)+
+ halt
+
+ .align 1
+sig8:
+ .word 0x0000
+ pushl 8(ap)
+ movl (sp)+,ap
+ pushl tab [ap]
+ jsb .trp
+ movl $m1,ap
+ chmk (ap)+
+ ret
+
+ .data
+m1:
+ .word 48
+ .long 2
+ .long 8
+ .long sig8
+m2:
+ .word 1
+ .long 1
+ .long 0
+.reghp:
+ .long _end
+hol0:
+ .space 8
+.trppc:
+ .space 4
+.trpim:
+ .long 0
+tab:
+ .long 0
+ .long EIOVFL
+ .long EIDIVZ
+ .long EFOVFL
+ .long EFDIVZ
+ .long EFUNFL
+ .long EILLINS
+ .long EARRAY
+ .long EFOVFL
+ .long EFDIVZ
+ .long EFUNFL
--- /dev/null
+.set ioctl,54
+.globl _ioctl
+.globl cerror
+
+_ioctl:
+ .word 0x0000
+ chmk $ioctl
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set kill,37
+.globl _kill
+.globl cerror
+
+_kill:
+ .word 0x0000
+ chmk $kill
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set link,9
+.globl _link
+.globl cerror
+
+_link:
+ .word 0x0000
+ chmk $link
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set lseek,19
+.globl _lseek
+.globl cerror
+
+_lseek:
+ .word 0x0000
+ chmk $lseek
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set mknod,14
+.globl _mknod
+.globl cerror
+
+_mknod:
+ .word 0x0000
+ chmk $mknod
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set mount,21
+.globl _mount
+.globl cerror
+
+_mount:
+ .word 0x0000
+ chmk $mount
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set msg,49
+.globl _msgrcv
+.globl _msgctl
+.globl _msgsnd
+.globl _msgget
+.globl cerror
+
+_msgsnd:
+ .word 0x0000
+ pushl 16(ap)
+ pushl 12(ap)
+ pushl 8(ap)
+ pushl 4(ap)
+ pushl $3
+ calls $5,sys
+ ret
+
+_msgrcv:
+ .word 0x0000
+ pushl 20(sp)
+ pushl 16(ap)
+ pushl 12(ap)
+ pushl 8(ap)
+ pushl 4(ap)
+ pushl $2
+ calls $6,sys1
+ ret
+
+_msgctl:
+ .word 0x0000
+ pushl 12(ap)
+ pushl 8(ap)
+ pushl 4(ap)
+ pushl $1
+ calls $4,sys
+ ret
+
+_msgget:
+ .word 0x0000
+ pushl 8(ap)
+ pushl 4(ap)
+ pushl $0
+ calls $3,sys1
+ ret
+
+sys:
+ .word 0x0000
+ chmk $msg
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
+
+sys1:
+ .word 0x0000
+ chmk $msg
+ bcc ok1
+ jmp cerror
+ok1:
+ ret
--- /dev/null
+.set execve,59
+.globl _exect
+.globl cerror
+
+_exect:
+ .word 0x0000
+ bispsw $0x10
+ chmk $execve
+ jmp cerror
--- /dev/null
+.set nice,34
+.globl _nice
+.globl cerror
+
+_nice:
+ .word 0x0000
+ chmk $nice
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set open,5
+.globl _open
+.globl cerror
+
+_open:
+ .word 0x0000
+ chmk $open
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set pause,29
+.globl _pause
+.globl cerror
+
+_pause:
+ .word 0x0000
+ chmk $pause
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set pipe,42
+.globl _pipe
+.globl cerror
+
+_pipe:
+ .word 0x0000
+ chmk $pipe
+ bcc ok
+ jmp cerror
+ok:
+ movl 4(ap),r2
+ movl r0,(r2)+
+ movl r1,(r2)
+ clrl r0
+ ret
--- /dev/null
+.set plock,45
+.globl _plock
+.globl cerror
+
+_plock:
+ .word 0x0000
+ chmk $plock
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set prof,44
+.globl _profil
+
+_profil:
+ .word 0x0000
+ chmk $prof
+ ret
--- /dev/null
+.set ptrace,26
+.globl _ptrace
+.globl _errno
+.globl cerror
+
+_ptrace:
+ .word 0x0000
+ clrl _errno
+ chmk $ptrace
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set read,3
+.globl _read
+.globl cerror
+
+_read:
+ .word 0x0000
+ chmk $read
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set break,17
+.globl _sbrk
+.globl _brk
+.globl _end
+.globl cerror
+
+_sbrk:
+ .word 0x0000
+ movl nd,r0
+ tstl 4(ap)
+ jeql out
+ addl3 r0,4(ap),-(sp)
+ bcs ovfl
+ pushl $1
+ movl ap,r3
+ movl sp,ap
+ chmk $break
+ bcc ok
+ovfl:
+ jmp cerror
+ok:
+ movl nd,r0
+ addl2 4(r3),nd
+out:
+ ret
+
+.globl _brk
+
+_brk:
+ .word 0x0000
+ chmk $break
+ bcc ok2
+ jmp cerror
+ok2:
+ movl 4(ap),nd
+ clrl r0
+ ret
+
+ .data
+nd: .long _end
--- /dev/null
+.set sem,53
+.globl _semctl
+.globl _semget
+.globl _semop
+.globl cerror
+
+_semop:
+ .word 0x0000
+ pushl 12(ap)
+ pushl 8(ap)
+ pushl 4(ap)
+ pushl $2
+ calls $4,sys1
+ ret
+
+_semctl:
+ .word 0x0000
+ pushl 16(ap)
+ pushl 12(ap)
+ pushl 8(ap)
+ pushl 4(ap)
+ pushl $1
+ calls $5,sys1
+ ret
+
+_semget:
+ .word 0x0000
+ pushl 12(ap)
+ pushl 8(ap)
+ pushl 4(ap)
+ pushl $0
+ calls $4,sys1
+ ret
+
+sys1:
+ .word 0x0000
+ chmk $sem
+ bcc ok1
+ jmp cerror
+ok1:
+ ret
--- /dev/null
+.set setgid,46
+.globl _setgid
+.globl cerror
+
+_setgid:
+ .word 0x0000
+ chmk $setgid
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set setpgrp,39
+.globl _setpgrp
+.globl _getpgrp
+
+_setpgrp:
+ .word 0x0000
+ pushl $1
+ calls $1,pgrp
+ ret
+
+_getpgrp:
+ .word 0x0000
+ pushl $0
+ calls $1,pgrp
+ ret
+
+pgrp:
+ .word 0x0000
+ chmk $setpgrp
+ ret
--- /dev/null
+.set setuid,23
+.globl _setuid
+.globl cerror
+
+_setuid:
+ .word 0x0000
+ chmk $setuid
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set shm,52
+.globl _shmat
+.globl _shmctl
+.globl _shmdt
+.globl _shmget
+.globl cerror
+
+_shmat:
+ .word 0x0000
+ pushl 12(ap)
+ pushl 8(ap)
+ pushl 4(ap)
+ pushl $0
+ calls $4,sys1
+ ret
+
+_shmdt:
+ .word 0x0000
+ pushl 4(ap)
+ pushl $2
+ calls $2,sys
+ ret
+
+_shmctl:
+ .word 0x0000
+ pushl 12(ap)
+ pushl 8(ap)
+ pushl 4(ap)
+ pushl $1
+ calls $4,sys
+ ret
+
+_shmget:
+ .word 0x0000
+ pushl 12(ap)
+ pushl 8(ap)
+ pushl 4(ap)
+ pushl $3
+ calls $4,sys1
+ ret
+
+sys:
+ .word 0x0000
+ chmk $shm
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
+
+sys1:
+ .word 0x0000
+ chmk $shm
+ bcc ok1
+ jmp cerror
+ok1:
+ ret
--- /dev/null
+.set signal,48
+.globl _signal
+.globl cerror
+
+_signal:
+ .word 0x0000
+ chmk $signal
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set stat,18
+.globl _stat
+.globl cerror
+
+_stat:
+ .word 0x0000
+ chmk $stat
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set stime,25
+.globl _stime
+.globl cerror
+
+_stime:
+ .word 0x0000
+ movl *4(ap),4(ap)
+ chmk $stime
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set stty,31
+.globl _stty
+.globl cerror
+
+_stty:
+ .word 0x0000
+ chmk $stty
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set sync,36
+.globl _sync
+
+_sync:
+ .word 0x0000
+ chmk $sync
+ ret
--- /dev/null
+.globl _syscall
+.globl cerror
+
+_syscall:
+ .word 0x0000
+ movl 4(ap),r0
+ subl3 $1,(ap)+,(ap)
+ chmk r0
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set time,13
+.globl _time
+
+_time:
+ .word 0x0000
+ chmk $time
+ movl 4(ap),r1
+ beql out
+ movl r0,(r1)
+out:
+ ret
--- /dev/null
+.set times,43
+.globl _times
+.globl cerror
+
+_times:
+ .word 0x0000
+ chmk $times
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set ulimit,63
+.globl _ulimit
+.globl cerror
+
+_ulimit:
+ .word 0x0000
+ chmk $ulimit
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set umask,60
+.globl _umask
+.globl cerror
+
+_umask:
+ .word 0x0000
+ chmk $umask
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set umount,22
+.globl _umount
+.globl cerror
+
+_umount:
+ .word 0x0000
+ chmk $umount
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set utssys,57
+
+.globl _uname
+.globl cerror
+
+_uname:
+ .word 0x0000
+ pushl $0
+ pushl $0
+ pushl 4(ap)
+ calls $3,sys
+ ret
+
+sys:
+ .word 0x0000
+ chmk $utssys
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set unlink,10
+.globl _unlink
+.globl cerror
+
+_unlink:
+ .word 0x0000
+ chmk $unlink
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set utssys,57
+.globl _ustat
+.globl cerror
+
+_ustat:
+ .word 0x0000
+ pushl $2
+ pushl 4(ap)
+ pushl 8(ap)
+ calls $3,sys
+ ret
+
+sys:
+ .word 0x0000
+ chmk $utssys
+ bcc ok
+ jmp cerror
+ok:
+ clrl r0
+ ret
--- /dev/null
+.set utime,30
+.globl _utime
+.globl cerror
+
+_utime:
+ .word 0x0000
+ chmk $utime
+ bcc ok
+ jmp cerror
+ok:
+ ret
--- /dev/null
+.set wait,7
+.globl _wait
+.globl cerror
+
+_wait:
+ .word 0x0000
+ chmk $wait
+ bcc ok
+ jmp cerror
+ok:
+ tstl 4(ap)
+ beql out
+ movl r1,*4(ap)
+out:
+ ret
--- /dev/null
+.set write,4
+.globl _write
+.globl cerror
+
+_write:
+ .word 0x0000
+ chmk $write
+ bcc out
+ jmp cerror
+out:
+ ret