--- /dev/null
+tail_mon.a
+exit.s
+_exit.s
+access.s
+alarm.s
+chdir.s
+chmod.s
+chroot.s
+close.s
+creat.s
+execl.s
+execve.s
+fork.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
+read.s
+setgid.s
+setuid.s
+stat.s
+stime.s
+sync.s
+time.s
+times.s
+umount.s
+unlink.s
+write.s
+brk.s
+wait.s
+fstat.s
+signal.s
+call.s
+cleanup.s
--- /dev/null
+.define __exit
+.extern __exit
+.text
+__exit: move.w #0x1,d0
+ move.w 4(sp),a0
+ trap #0
--- /dev/null
+.define _access
+.extern _access
+.text
+_access: move.w #0x21,d0
+ move.l 4(sp),a0
+ move.w 8(sp),d1
+ ext.l d1
+ jmp callc
--- /dev/null
+.define _alarm
+.extern _alarm
+.text
+_alarm: clr.l d0
+ move.w 4(sp),d0
+ move.l d0,a0
+ move.w #0x1B,d0
+ trap #0
+ rts
--- /dev/null
+.define _brk
+.define _sbrk
+.extern _brk
+.extern _sbrk
+.text
+_sbrk: move.l nd,d0
+ add.l d0, 4(sp)
+ move.w #0x11,d0
+ move.l 4(sp),a0
+ trap #0
+ bcs lcerror
+ move.l nd,d0
+ move.l 4(sp),nd
+ rts
+lcerror: jmp cerror
+_brk: move.w #0x11,d0
+ move.l 4(sp),a0
+ trap #0
+ bcs lcerror
+ move.l 4(sp),nd
+ clr.l d0
+ rts
+.data
+nd: .long endbss
+.text
--- /dev/null
+.define call
+.define callc
+.define calle
+.define cerror
+.define _errno
+.extern call
+.extern callc
+.extern calle
+.extern cerror
+.extern _errno
+.text
+call: trap #0
+ bcs cerror
+ rts
+callc:
+ trap #0
+ bcs cerror
+ clr.l d0
+ rts
+calle:
+ trap #0
+cerror:
+ move.w d0,_errno
+ move.l #-1,d0
+ rts
+.bss
+_errno: .space 4
+.text
--- /dev/null
+.define _chdir
+.extern _chdir
+.text
+_chdir: move.w #0xC,d0
+ move.l 4(sp),a0
+ jmp callc
--- /dev/null
+.define _chmod
+.extern _chmod
+.text
+_chmod: move.w #0xF,d0
+ move.l 4(sp),a0
+ move.w 8(sp),d1
+ ext.l d1
+ jmp callc
--- /dev/null
+.define _chroot
+.extern _chroot
+.text
+_chroot: move.w #0x3D,d0
+ move.l 4(sp),a0
+ jmp callc
--- /dev/null
+.define __cleanup
+.extern __cleanup
+.text
+__cleanup:
+tst.b -40(sp)
+link a6,#-0
+unlk a6
+rts
--- /dev/null
+.define _close
+.extern _close
+.text
+_close: move.w #0x6,d0
+ move.w 4(sp),a0
+ jmp callc
--- /dev/null
+.define _creat
+.extern _creat
+.text
+_creat: move.w #0x8,d0
+ move.l 4(sp),a0
+ move.w 8(sp),d1
+ ext.l d1
+ jmp call
--- /dev/null
+.define _execl
+.extern _execl
+_execl: link a6,#0
+ tst.b -132(sp)
+ move.l _environ,-(sp)
+ pea 12(sp)
+ move.l 8(a6),-(sp)
+ jsr _execve
+ add.l #0xC,sp
+ unlk a6
+ rts
--- /dev/null
+.define _execve
+.extern _execve
+.text
+_execve: move.w #0x3B,d0
+ move.l 4(sp),a0
+ move.l 8(sp),d1
+ move.l 12(sp),a1
+ jmp calle
--- /dev/null
+.define _exit
+.extern _exit
+.text
+_exit:
+tst.b -40(sp)
+link a6,#-0
+jsr __cleanup
+move.w 8(a6),-(sp)
+jsr __exit
+add.l #2,sp
+unlk a6
+rts
--- /dev/null
+.define _fork
+.extern _fork
+.text
+_fork: move.w #0x2,d0
+ trap #0
+ bra 1f
+ bcc 2f
+ jmp cerror
+1:
+ !move.l d0,p_uid
+ clr.l d0
+2:
+ rts
--- /dev/null
+.define _fstat
+.extern _fstat
+_fstat: move.w #0x1C,d0
+ move.w 4(sp),a0
+ move.l 6(sp),d1
+ jmp callc
--- /dev/null
+.define _getegid
+.extern _getegid
+.text
+_getegid: move.w #0x2F,d0
+ trap #0
+ move.l d1,d0
+ rts
--- /dev/null
+.define _getgid
+.extern _getgid
+.text
+_getgid: move.w #0x2F,d0
+ trap #0
+ rts
--- /dev/null
+.define _getpid
+.extern _getpid
+.text
+_getpid: move.w #0x14,d0
+ trap #0
+ rts
--- /dev/null
+.define _getuid
+.extern _getuid
+.text
+_getuid: move.w #0x18,d0
+ trap #0
+ rts
--- /dev/null
+.define _gtty
+.extern _gtty
+.text
+_gtty:
+tst.b -40(sp)
+link a6,#-0
+move.l 10(a6),-(sp)
+move.w #29704,-(sp)
+move.w 8(a6),-(sp)
+jsr _ioctl
+add.l #8,sp
+unlk a6
+rts
--- /dev/null
+.define _ioctl
+.extern _ioctl
+.text
+_ioctl: move.w #0x36,d0
+ move.w 4(sp),a0
+ move.w 6(sp),d1
+ ext.l d1
+ move.l 8(sp),a1
+ jmp callc
--- /dev/null
+.define _kill
+.extern _kill
+.text
+_kill: move.w #0x25,d0
+ move.w 4(sp),a0
+ move.w 6(sp),d1
+ ext.l d1
+ jmp callc
--- /dev/null
+.define _link
+.extern _link
+.text
+_link: move.w #0x9,d0
+ move.l 4(sp),a0
+ move.w 8(sp),d1
+ ext.l d1
+ jmp callc
--- /dev/null
+.define _lseek
+.extern _lseek
+.text
+_lseek: move.w #0x13,d0
+ move.w 4(sp),a0
+ move.l 6(sp),d1
+ move.w 10(sp),a1
+ jmp call
--- /dev/null
+.define _mknod
+.extern _mknod
+.text
+_mknod: move.w #0xE,d0
+ move.l 4(sp),a0
+ move.w 8(sp),d1
+ ext.l d1
+ move.w 10(sp),a1
+ jmp callc
--- /dev/null
+
+.define _mount
+.extern _mount
+.text
+_mount: move.w #0x15,d0
+ move.l 4(sp),a0
+ move.l 8(sp),d1
+ move.l 12(sp),a1
+ jmp callc
--- /dev/null
+.define _nice
+.extern _nice
+.text
+_nice: move.w #0x22,d0
+ move.w 4(sp),a0
+ jmp callc
--- /dev/null
+.define _open
+.extern _open
+.text
+_open: move.w #0x5,d0
+ move.l 4(sp),a0
+ move.w 8(sp),d1
+ ext.l d1
+ jmp call
--- /dev/null
+.define _pause
+.extern _pause
+.text
+_pause: move.w #0x1D,d0
+ trap #0
+ rts
--- /dev/null
+.define _read
+.extern _read
+.text
+_read: move.w #0x3,d0
+ move.w 4(sp),a0
+ move.l 6(sp),d1
+ move.w 10(sp),a1
+ jmp call
--- /dev/null
+.define _setgid
+.extern _setgid
+.text
+_setgid: move.w #0x2E,d0
+ move.w 4(sp),a0
+ jmp callc
--- /dev/null
+.define _setuid
+.extern _setuid
+.text
+_setuid: move.w #0x17,d0
+ move.w 4(sp),a0
+ jmp callc
--- /dev/null
+.define _signal
+.extern _signal
+NSIG=32
+_signal:
+ move.w 4(sp), d0
+ ext.l d0
+ cmp.l #NSIG,d0
+ bcc 1f
+ move.l 6(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 #enter,d1
+2:
+ move.l d0,a0
+ move.w #0x30,d0
+ trap #0
+ bcs 3f
+ btst #0,d0
+ bne 4f
+ move.l a1,d0
+4:
+ rts
+1:
+ move.l #22,d0
+3:
+ jmp cerror
+
+enter:
+ movem.l d0/d1/a0/a1,-(sp)
+ move.l 16(sp),a0
+ move.l a0,-(sp)
+ 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
+.bss
+dvect: .space 4*NSIG
--- /dev/null
+.define _stat
+.extern _stat
+.text
+_stat: move.w #0x12,d0
+ move.l 4(sp),a0
+ move.w 8(sp),d1
+ ext.l d1
+ jmp callc
--- /dev/null
+.define _stime
+.extern _stime
+.text
+_stime: move.w #0x19,d0
+ move.l 4(sp),a0
+ move.l (a0),a0
+ trap #0
+ bcs 1f
+ rts
+1:
+ jmp cerror
--- /dev/null
+.define _stty
+.extern _stty
+.text
+_stty:
+tst.b -40(sp)
+link a6,#-0
+move.l 10(a6),-(sp)
+move.w #29705,-(sp)
+move.w 8(a6),-(sp)
+jsr _ioctl
+add.l #8,sp
+unlk a6
+rts
--- /dev/null
+.define _sync
+.extern _sync
+.text
+_sync: move.w #0x24,d0
+ trap #0
+ rts
--- /dev/null
+.define _time
+.extern _time
+.text
+_time: move.w #0xD,d0
+ trap #0
+ tst.l 4(sp)
+ beq 1f
+ move.l 4(sp),a0
+ move.l d0,(a0)
+1:
+ rts
--- /dev/null
+.define _times
+.extern _times
+.text
+_times: move.w #0x2B,d0
+ move.w 4(sp),a0
+ trap #0
+ rts
--- /dev/null
+.define _umount
+.extern _umount
+.text
+_umount: move.w #0x16,d0
+ move.l 4(sp),a0
+ jmp callc
--- /dev/null
+.define _unlink
+.extern _unlink
+.text
+_unlink: move.w #0xA,d0
+ move.l 4(sp),a0
+ jmp callc
--- /dev/null
+.define _wait
+.extern _wait
+_wait: move.w #0x7,d0
+ move.l 4(sp),a0
+ trap #0
+ bcs cerror
+ tst.l 4(sp)
+ beq 1f
+ move.l 4(sp),a0
+ move.w d1,(a0)
+1:
+ rts
--- /dev/null
+.define _write
+.extern _write
+.text
+_write: move.w #0x4,d0
+ move.w 4(sp),a0
+ move.l 6(sp),d1
+ move.w 10(sp),a1
+ jmp call
--- /dev/null
+tail_mon.a
+exit.s
+_exit.s
+access.s
+alarm.s
+chdir.s
+chmod.s
+chroot.s
+close.s
+creat.s
+execl.s
+execve.s
+fork.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
+read.s
+setgid.s
+setuid.s
+stat.s
+stime.s
+sync.s
+time.s
+times.s
+umount.s
+unlink.s
+write.s
+brk.s
+wait.s
+fstat.s
+signal.s
+call.s
+cleanup.s
--- /dev/null
+.define __exit
+.extern __exit
+.text
+__exit: move.w #0x1,d0
+ move.w 4(sp),a0
+ trap #0
--- /dev/null
+.define _access
+.extern _access
+.text
+_access: move.w #0x21,d0
+ move.l 4(sp),a0
+ move.w 8(sp),d1
+ ext.l d1
+ jmp callc
--- /dev/null
+.define _alarm
+.extern _alarm
+.text
+_alarm: clr.l d0
+ move.w 4(sp),d0
+ move.l d0,a0
+ move.w #0x1B,d0
+ trap #0
+ rts
--- /dev/null
+.define _brk
+.define _sbrk
+.extern _brk
+.extern _sbrk
+.text
+_sbrk: move.l nd,d0
+ add.l d0, 4(sp)
+ move.w #0x11,d0
+ move.l 4(sp),a0
+ trap #0
+ bcs lcerror
+ move.l nd,d0
+ move.l 4(sp),nd
+ rts
+lcerror: jmp cerror
+_brk: move.w #0x11,d0
+ move.l 4(sp),a0
+ trap #0
+ bcs lcerror
+ move.l 4(sp),nd
+ clr.l d0
+ rts
+.data
+nd: .long endbss
+.text
--- /dev/null
+.define call
+.define callc
+.define calle
+.define cerror
+.define _errno
+.extern call
+.extern callc
+.extern calle
+.extern cerror
+.extern _errno
+.text
+call: trap #0
+ bcs cerror
+ rts
+callc:
+ trap #0
+ bcs cerror
+ clr.l d0
+ rts
+calle:
+ trap #0
+cerror:
+ move.w d0,_errno
+ move.l #-1,d0
+ rts
+.bss
+_errno: .space 4
+.text
--- /dev/null
+.define _chdir
+.extern _chdir
+.text
+_chdir: move.w #0xC,d0
+ move.l 4(sp),a0
+ jmp callc
--- /dev/null
+.define _chmod
+.extern _chmod
+.text
+_chmod: move.w #0xF,d0
+ move.l 4(sp),a0
+ move.w 8(sp),d1
+ ext.l d1
+ jmp callc
--- /dev/null
+.define _chroot
+.extern _chroot
+.text
+_chroot: move.w #0x3D,d0
+ move.l 4(sp),a0
+ jmp callc
--- /dev/null
+.define __cleanup
+.extern __cleanup
+.text
+__cleanup:
+tst.b -40(sp)
+link a6,#-0
+unlk a6
+rts
--- /dev/null
+.define _close
+.extern _close
+.text
+_close: move.w #0x6,d0
+ move.w 4(sp),a0
+ jmp callc
--- /dev/null
+.define _creat
+.extern _creat
+.text
+_creat: move.w #0x8,d0
+ move.l 4(sp),a0
+ move.w 8(sp),d1
+ ext.l d1
+ jmp call
--- /dev/null
+.define _execl
+.extern _execl
+_execl: link a6,#0
+ tst.b -132(sp)
+ move.l _environ,-(sp)
+ pea 12(sp)
+ move.l 8(a6),-(sp)
+ jsr _execve
+ add.l #0xC,sp
+ unlk a6
+ rts
--- /dev/null
+.define _execve
+.extern _execve
+.text
+_execve: move.w #0x3B,d0
+ move.l 4(sp),a0
+ move.l 8(sp),d1
+ move.l 12(sp),a1
+ jmp calle
--- /dev/null
+.define _exit
+.extern _exit
+.text
+_exit:
+tst.b -40(sp)
+link a6,#-0
+jsr __cleanup
+move.w 8(a6),-(sp)
+jsr __exit
+add.l #2,sp
+unlk a6
+rts
--- /dev/null
+.define _fork
+.extern _fork
+.text
+_fork: move.w #0x2,d0
+ trap #0
+ bra 1f
+ bcc 2f
+ jmp cerror
+1:
+ !move.l d0,p_uid
+ clr.l d0
+2:
+ rts
--- /dev/null
+.define _fstat
+.extern _fstat
+_fstat: move.w #0x1C,d0
+ move.w 4(sp),a0
+ move.l 6(sp),d1
+ jmp callc
--- /dev/null
+.define _getegid
+.extern _getegid
+.text
+_getegid: move.w #0x2F,d0
+ trap #0
+ move.l d1,d0
+ rts
--- /dev/null
+.define _getgid
+.extern _getgid
+.text
+_getgid: move.w #0x2F,d0
+ trap #0
+ rts
--- /dev/null
+.define _getpid
+.extern _getpid
+.text
+_getpid: move.w #0x14,d0
+ trap #0
+ rts
--- /dev/null
+.define _getuid
+.extern _getuid
+.text
+_getuid: move.w #0x18,d0
+ trap #0
+ rts
--- /dev/null
+.define _gtty
+.extern _gtty
+.text
+_gtty:
+tst.b -40(sp)
+link a6,#-0
+move.l 10(a6),-(sp)
+move.w #29704,-(sp)
+move.w 8(a6),-(sp)
+jsr _ioctl
+add.l #8,sp
+unlk a6
+rts
--- /dev/null
+.define _ioctl
+.extern _ioctl
+.text
+_ioctl: move.w #0x36,d0
+ move.w 4(sp),a0
+ move.w 6(sp),d1
+ ext.l d1
+ move.l 8(sp),a1
+ jmp callc
--- /dev/null
+.define _kill
+.extern _kill
+.text
+_kill: move.w #0x25,d0
+ move.w 4(sp),a0
+ move.w 6(sp),d1
+ ext.l d1
+ jmp callc
--- /dev/null
+.define _link
+.extern _link
+.text
+_link: move.w #0x9,d0
+ move.l 4(sp),a0
+ move.w 8(sp),d1
+ ext.l d1
+ jmp callc
--- /dev/null
+.define _lseek
+.extern _lseek
+.text
+_lseek: move.w #0x13,d0
+ move.w 4(sp),a0
+ move.l 6(sp),d1
+ move.w 10(sp),a1
+ jmp call
--- /dev/null
+.define _mknod
+.extern _mknod
+.text
+_mknod: move.w #0xE,d0
+ move.l 4(sp),a0
+ move.w 8(sp),d1
+ ext.l d1
+ move.w 10(sp),a1
+ jmp callc
--- /dev/null
+
+.define _mount
+.extern _mount
+.text
+_mount: move.w #0x15,d0
+ move.l 4(sp),a0
+ move.l 8(sp),d1
+ move.l 12(sp),a1
+ jmp callc
--- /dev/null
+.define _nice
+.extern _nice
+.text
+_nice: move.w #0x22,d0
+ move.w 4(sp),a0
+ jmp callc
--- /dev/null
+.define _open
+.extern _open
+.text
+_open: move.w #0x5,d0
+ move.l 4(sp),a0
+ move.w 8(sp),d1
+ ext.l d1
+ jmp call
--- /dev/null
+.define _pause
+.extern _pause
+.text
+_pause: move.w #0x1D,d0
+ trap #0
+ rts
--- /dev/null
+.define _read
+.extern _read
+.text
+_read: move.w #0x3,d0
+ move.w 4(sp),a0
+ move.l 6(sp),d1
+ move.w 10(sp),a1
+ jmp call
--- /dev/null
+.define _setgid
+.extern _setgid
+.text
+_setgid: move.w #0x2E,d0
+ move.w 4(sp),a0
+ jmp callc
--- /dev/null
+.define _setuid
+.extern _setuid
+.text
+_setuid: move.w #0x17,d0
+ move.w 4(sp),a0
+ jmp callc
--- /dev/null
+.define _signal
+.extern _signal
+NSIG=32
+_signal:
+ move.w 4(sp), d0
+ ext.l d0
+ cmp.l #NSIG,d0
+ bcc 1f
+ move.l 6(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 #enter,d1
+2:
+ move.l d0,a0
+ move.w #0x30,d0
+ trap #0
+ bcs 3f
+ btst #0,d0
+ bne 4f
+ move.l a1,d0
+4:
+ rts
+1:
+ move.l #22,d0
+3:
+ jmp cerror
+
+enter:
+ movem.l d0/d1/a0/a1,-(sp)
+ move.l 16(sp),a0
+ move.l a0,-(sp)
+ 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
+.bss
+dvect: .space 4*NSIG
--- /dev/null
+.define _stat
+.extern _stat
+.text
+_stat: move.w #0x12,d0
+ move.l 4(sp),a0
+ move.w 8(sp),d1
+ ext.l d1
+ jmp callc
--- /dev/null
+.define _stime
+.extern _stime
+.text
+_stime: move.w #0x19,d0
+ move.l 4(sp),a0
+ move.l (a0),a0
+ trap #0
+ bcs 1f
+ rts
+1:
+ jmp cerror
--- /dev/null
+.define _stty
+.extern _stty
+.text
+_stty:
+tst.b -40(sp)
+link a6,#-0
+move.l 10(a6),-(sp)
+move.w #29705,-(sp)
+move.w 8(a6),-(sp)
+jsr _ioctl
+add.l #8,sp
+unlk a6
+rts
--- /dev/null
+.define _sync
+.extern _sync
+.text
+_sync: move.w #0x24,d0
+ trap #0
+ rts
--- /dev/null
+.define _time
+.extern _time
+.text
+_time: move.w #0xD,d0
+ trap #0
+ tst.l 4(sp)
+ beq 1f
+ move.l 4(sp),a0
+ move.l d0,(a0)
+1:
+ rts
--- /dev/null
+.define _times
+.extern _times
+.text
+_times: move.w #0x2B,d0
+ move.w 4(sp),a0
+ trap #0
+ rts
--- /dev/null
+.define _umount
+.extern _umount
+.text
+_umount: move.w #0x16,d0
+ move.l 4(sp),a0
+ jmp callc
--- /dev/null
+.define _unlink
+.extern _unlink
+.text
+_unlink: move.w #0xA,d0
+ move.l 4(sp),a0
+ jmp callc
--- /dev/null
+.define _wait
+.extern _wait
+_wait: move.w #0x7,d0
+ move.l 4(sp),a0
+ trap #0
+ bcs cerror
+ tst.l 4(sp)
+ beq 1f
+ move.l 4(sp),a0
+ move.w d1,(a0)
+1:
+ rts
--- /dev/null
+.define _write
+.extern _write
+.text
+_write: move.w #0x4,d0
+ move.w 4(sp),a0
+ move.l 6(sp),d1
+ move.w 10(sp),a1
+ jmp call