ack/mach/mantra/int/mloopc

515 lines
7.1 KiB
Plaintext
Raw Normal View History

1986-12-09 11:13:14 +00:00
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
1984-07-23 11:49:00 +00:00
!THIS FILE CONTAINS THE SYSTEM CALLS FOR PMDS-II AS SUBROUTINES FOR THE
!EM-INTERPRETER. a1 CONTAINS A POINTER TO THE RETURN AREA . EACH SUBROUTINE
!EXPECTS ITS DATA IN THE FORM EM PRODUCES AND GIVES ITS RESULTS AS EM
!REQUIRES.
!THE PMDS-II REQUIRES THE ARGUMENTS ON THE STACK AS 4 BYTE INTEGERS OR
!POINTERS , AND USES THE C-CALLING CONVENTION. THE 2 BYTE WORDS 4 BYTE
!POINTERS VERSION HAS TO DO SOME CONVERSION FIRST .
1984-07-23 11:49:00 +00:00
1987-03-30 09:39:38 +00:00
_Xexit: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 1
1984-07-23 11:49:00 +00:00
1987-03-30 09:39:38 +00:00
_Xfork: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 2
1984-07-23 11:49:00 +00:00
lea 4(sp),sp
bcs 2f
tst.l d0 !PID OF CHILD IN PARENT, 0 IN CHILD
bne 1f
trap #0
1986-12-09 11:13:14 +00:00
.data2 20
1984-07-23 11:49:00 +00:00
mov d1,-(sp) !PID OF PARENT IN d1
mov #1,-(sp) !(PID OF CHILD IN D0),FLAG 1 IN CHILD
bra 0f
1: mov d0,-(sp) !PID OF CHILD IN d0
cl -(sp) !FLAG 0 IN PARENT
0: cl -(sp)
bra 3f
2: mov d0,-(sp)
mov d0,-(sp)
3: move.l (a1),a0
jmp (a0)
1987-03-30 09:39:38 +00:00
!_Xfork is special
1984-07-23 11:49:00 +00:00
1987-03-30 09:39:38 +00:00
_Xread: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 3
1984-07-23 11:49:00 +00:00
sys0: lea 16(sp),sp
bcc 1f
mov d0,-(sp)
mov d0,-(sp)
bra 2f
1: move.l d0,-(sp)
cl -(sp)
2: move.l (a1),a0
jmp (a0)
1987-03-30 09:39:38 +00:00
_Xwrite: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 4
1984-07-23 11:49:00 +00:00
bra sys0
1987-03-30 09:39:38 +00:00
_Xopen: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st243
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 5
1984-07-23 11:49:00 +00:00
sys1: lea 12(sp),sp
sys5: bcc 1f
mov d0,-(sp)
mov d0,-(sp)
bra 2f
1: mov d0,-(sp)
cl -(sp)
2: move.l (a1),a0
jmp (a0)
1987-03-30 09:39:38 +00:00
_Xclose: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 6
1984-07-23 11:49:00 +00:00
sys3: lea 8(sp),sp
sys4: bcc 1f
mov d0,-(sp)
mov d0,-(sp)
bra 2f
1: cl -(sp)
2: move.l (a1),a0
jmp (a0)
1987-03-30 09:39:38 +00:00
_Xwait: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 7
1984-07-23 11:49:00 +00:00
sys6: lea 4(sp),sp
bcc 1f
mov d0,-(sp)
mov d0,-(sp)
bra 2f
1: mov d1,-(sp) ! ??
mov d0,-(sp)
cl -(sp)
2: move.l (a1),a0
jmp (a0)
1987-03-30 09:39:38 +00:00
_Xcreat: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st243
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 8
1984-07-23 11:49:00 +00:00
bra sys1
1987-03-30 09:39:38 +00:00
_Xlink: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 9
1984-07-23 11:49:00 +00:00
lea 12(sp),sp
bra sys4
1987-03-30 09:39:38 +00:00
_Xunlink: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 10
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-30 09:39:38 +00:00
_Xchdir: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 12
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-30 09:39:38 +00:00
_Xmknod: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st244
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 14
1984-07-23 11:49:00 +00:00
lea 16(sp),sp
bra sys4
1987-03-30 09:39:38 +00:00
_Xchmod: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st243
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 15
1984-07-23 11:49:00 +00:00
lea 12(sp),sp
bra sys4
1987-03-30 09:39:38 +00:00
_Xchown: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st244
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 16
1984-07-23 11:49:00 +00:00
lea 16(sp),sp
bra sys4
1987-03-30 09:39:38 +00:00
_Xbreak: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 17
1984-07-23 11:49:00 +00:00
lea 8(sp),sp
bcc 1f
mov d0,-(sp)
mov d0,-(sp)
bra 2f
1: move.l -4(sp),nd
cl -(sp)
2: move.l (a1),a0
jmp (a0)
1986-12-09 11:13:14 +00:00
.sect .data
nd: .data4 endbss
.sect .text
1984-07-23 11:49:00 +00:00
1987-03-30 09:39:38 +00:00
_Xstat: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 18
1984-07-23 11:49:00 +00:00
lea 12(sp),sp
bra sys4
1987-03-30 09:39:38 +00:00
_Xlseek: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st245
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 19
1984-07-23 11:49:00 +00:00
lea 16(sp),sp
bcc 1f
mov d0,-(sp)
mov d0,-(sp)
bra 2f
1: move.l d0,-(sp)
1984-07-23 11:49:00 +00:00
cl -(sp)
2: move.l (a1),a0
jmp (a0)
1987-03-30 09:39:38 +00:00
_Xgetpid: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 20
1984-07-23 11:49:00 +00:00
add.l #4,sp
mov d0,-(sp)
move.l (a1),a0
jmp (a0)
1987-03-30 09:39:38 +00:00
_Xmount: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st246
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 21
1984-07-23 11:49:00 +00:00
lea 16(sp),sp
bra sys4
1987-03-30 09:39:38 +00:00
_Xumount: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 22
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-30 09:39:38 +00:00
_Xsetuid: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 23
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-30 09:39:38 +00:00
_Xgetuid: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 24
1984-07-23 11:49:00 +00:00
sys7: add.l #4,sp
mov d1,-(sp)
mov d0,-(sp)
move.l (a1),a0
jmp (a0)
1987-03-30 09:39:38 +00:00
_Xstime: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 25
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-30 09:39:38 +00:00
_Xptrace: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st247
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 26
1984-07-23 11:49:00 +00:00
lea 20(sp),sp
bra sys5
1987-03-30 09:39:38 +00:00
_Xalarm: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
sub.l #2,sp
clr.w 4(sp)
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 27
1984-07-23 11:49:00 +00:00
lea 8(sp),sp
mov d0,-(sp)
move.l (a1),a0
jmp (a0)
1987-03-30 09:39:38 +00:00
_Xfstat: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 28
1984-07-23 11:49:00 +00:00
lea 12(sp),sp
bra sys4
1987-03-30 09:39:38 +00:00
_Xpause: trap #0
1986-12-09 11:13:14 +00:00
.data2 29
1984-07-23 11:49:00 +00:00
rts
1987-03-30 09:39:38 +00:00
_Xutime: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 30
1984-07-23 11:49:00 +00:00
lea 12(sp),sp
bra sys4
1987-03-30 09:39:38 +00:00
_Xaccess: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st248
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 33
1984-07-23 11:49:00 +00:00
lea 12(sp),sp
bra sys4
1987-03-30 09:39:38 +00:00
_Xnice:
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr 241
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 34
1984-07-23 11:49:00 +00:00
move.l (sp)+,(sp)
rts
1987-03-30 09:39:38 +00:00
_Xftime: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 35
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-30 09:39:38 +00:00
_Xsync: trap #0
1986-12-09 11:13:14 +00:00
.data2 36
1984-07-23 11:49:00 +00:00
rts
1987-03-30 09:39:38 +00:00
_Xkill: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st248
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 37
1984-07-23 11:49:00 +00:00
lea 12(sp),sp
bra sys4
1987-03-30 09:39:38 +00:00
_Xdup: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st248
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 38
1984-07-23 11:49:00 +00:00
bra sys1
1987-03-30 09:39:38 +00:00
_Xpipe: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 42
1984-07-23 11:49:00 +00:00
bra sys6
1987-03-30 09:39:38 +00:00
_Xtimes: trap #0
1986-12-09 11:13:14 +00:00
.data2 43
1984-07-23 11:49:00 +00:00
move.l (sp),a0
add.l #8,sp
jmp (a0)
1987-03-30 09:39:38 +00:00
_Xprofil: trap #0
1986-12-09 11:13:14 +00:00
.data2 44
1984-07-23 11:49:00 +00:00
move.l (sp),a0
lea 20(sp),sp
jmp (a0)
1987-03-30 09:39:38 +00:00
_Xsetgid: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 46
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-30 09:39:38 +00:00
_Xgetgid: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 47
1984-07-23 11:49:00 +00:00
bra sys7
1987-03-30 09:39:38 +00:00
_Xsignal: move.l (sp)+,retaddr
1984-07-23 11:49:00 +00:00
mov (sp)+,d4
extend d4
move.l d4,-(sp)
move.l retaddr,-(sp)
trap #0
1986-12-09 11:13:14 +00:00
.data2 48
lea 12(sp),sp !remove arguments
bcc 1f
1984-07-23 11:49:00 +00:00
mov d0,-(sp)
mov d0,-(sp)
bra 2f
1: mov d0,-(sp)
cl -(sp)
2: move.l retaddr,a0
1984-07-23 11:49:00 +00:00
jmp (a0)
1986-12-09 11:13:14 +00:00
.sect .data
retaddr: .data4 0
.sect .text
1984-07-23 11:49:00 +00:00
1987-03-30 09:39:38 +00:00
_Xacct: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 51
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-30 09:39:38 +00:00
_Xlock: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 53
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-30 09:39:38 +00:00
_Xioctl: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st248
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 54
1984-07-23 11:49:00 +00:00
lea 16(sp),sp
bra sys4
1987-03-30 09:39:38 +00:00
!_Xmpxcall: move.l (sp),(a1)
!#ifndef lword
! bsr st241
!#endif
! trap #0
! .data2 56
! lea 12(sp),sp
! bra sys4
1984-07-23 11:49:00 +00:00
1987-03-30 09:39:38 +00:00
_Xexece: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 59
1984-07-23 11:49:00 +00:00
lea 16(sp),sp
bra sys4
1987-03-30 09:39:38 +00:00
_Xumask: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 60
1984-07-23 11:49:00 +00:00
add.l #8,sp
mov d0,-(sp)
move.l (a1),a0
jmp (a0)
1987-03-30 09:39:38 +00:00
_Xchroot: move.l (sp),(a1)
1984-07-23 11:49:00 +00:00
trap #0
1986-12-09 11:13:14 +00:00
.data2 61
1984-07-23 11:49:00 +00:00
bra sys3
!----------------------------------------------------------------------------
! STACK ADJUSTMENT FOR THE TWO BYTE INTERPRETER
!-----------------------------------------------------------------------------
#ifndef lword
st241: sub.l #2,sp
move.l 2(sp),(sp)
move.l 6(sp),4(sp)
move.w 10(sp),d0
ext.l d0
move.l d0,8(sp)
rts
st243: sub.l #2,sp
move.l 2(sp),(sp)
move.l 6(sp),4(sp)
move.l 10(sp),8(sp)
move.w 14(sp),d0
ext.l d0
move.l d0,12(sp)
rts
st244: move.l (sp),-(sp)
move.l 8(sp),4(sp)
move.l 12(sp),8(sp)
move.w 16(sp),d0
ext.l d0
move.l d0,12(sp)
move.w 18(sp),d0
ext.l d0
move.l d0,16(sp)
rts
st245: move.l (sp),-(sp)
move.l 8(sp),4(sp)
move.w 12(sp),d0
ext.l d0
move.l d0,8(sp)
move.l 14(sp),12(sp)
move.w 18(sp),d0
ext.l d0
move.l d0,16(sp)
rts
st246: sub.l #2,sp
move.l 2(sp),(sp)
move.l 6(sp),4(sp)
move.l 10(sp),8(sp)
move.l 14(sp),12(sp)
move.w 18(sp),d0
ext.l d0
move.l d0,16(sp)
rts
st247: sub.l #6,sp
move.l 6(sp),(sp)
move.l 10(sp),4(sp)
move.w 14(sp),d0
ext.l d0
move.l d0,8(sp)
move.w 16(sp),d0
ext.l d0
move.l d0,12(sp)
move.l 18(sp),16(sp)
move.w 22(sp),d0
ext.l d0
move.l d0,20(sp)
rts
st248: move.l (sp),-(sp)
move.l 8(sp),4(sp)
move.w 12(sp),d0
ext.l d0
move.l d0,8(sp)
move.w 14(sp),d0
ext.l d0
move.l d0,12(sp)
rts
#endif