ack/mach/mantra/int/mloopc

515 lines
7 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
_exit: move.l (sp),(a1)
#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
_fork: move.l (sp),(a1)
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)
!_fork is special
_read: move.l (sp),(a1)
#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)
_write: move.l (sp),(a1)
#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
_open: move.l (sp),(a1)
#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)
_close: move.l (sp),(a1)
#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)
_wait: move.l (sp),(a1)
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)
_creat: move.l (sp),(a1)
#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
_link: move.l (sp),(a1)
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
_unlink: move.l (sp),(a1)
trap #0
1986-12-09 11:13:14 +00:00
.data2 10
1984-07-23 11:49:00 +00:00
bra sys3
_chdir: move.l (sp),(a1)
trap #0
1986-12-09 11:13:14 +00:00
.data2 12
1984-07-23 11:49:00 +00:00
bra sys3
_mknod: move.l (sp),(a1)
#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
_chmod: move.l (sp),(a1)
#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
_chown: move.l (sp),(a1)
#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
_break: move.l (sp),(a1)
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
_stat: move.l (sp),(a1)
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
_lseek: move.l (sp),(a1)
#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)
_getpid: move.l (sp),(a1)
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)
_mount: move.l (sp),(a1)
#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
_umount: move.l (sp),(a1)
trap #0
1986-12-09 11:13:14 +00:00
.data2 22
1984-07-23 11:49:00 +00:00
bra sys3
_setuid: move.l (sp),(a1)
#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
_getuid: move.l (sp),(a1)
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)
_stime: move.l (sp),(a1)
trap #0
1986-12-09 11:13:14 +00:00
.data2 25
1984-07-23 11:49:00 +00:00
bra sys3
_ptrace: move.l (sp),(a1)
#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
_alarm: move.l (sp),(a1)
#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)
_fstat: move.l (sp),(a1)
#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
_pause: trap #0
1986-12-09 11:13:14 +00:00
.data2 29
1984-07-23 11:49:00 +00:00
rts
_utime: move.l (sp),(a1)
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
_access: move.l (sp),(a1)
#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
_nice:
#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
_ftime: move.l (sp),(a1)
trap #0
1986-12-09 11:13:14 +00:00
.data2 35
1984-07-23 11:49:00 +00:00
bra sys3
_sync: trap #0
1986-12-09 11:13:14 +00:00
.data2 36
1984-07-23 11:49:00 +00:00
rts
_kill: move.l (sp),(a1)
#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
_dup: move.l (sp),(a1)
#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
_pipe: move.l (sp),(a1)
trap #0
1986-12-09 11:13:14 +00:00
.data2 42
1984-07-23 11:49:00 +00:00
bra sys6
_times: 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)
_profil: 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)
_setgid: move.l (sp),(a1)
#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
_getgid: move.l (sp),(a1)
trap #0
1986-12-09 11:13:14 +00:00
.data2 47
1984-07-23 11:49:00 +00:00
bra sys7
_signal: move.l (sp)+,retaddr
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
_acct: move.l (sp),(a1)
trap #0
1986-12-09 11:13:14 +00:00
.data2 51
1984-07-23 11:49:00 +00:00
bra sys3
_lock: move.l (sp),(a1)
#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
_ioctl: move.l (sp),(a1)
#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
_mpxcall: move.l (sp),(a1)
#ifndef lword
bsr st241
#endif
trap #0
1986-12-09 11:13:14 +00:00
.data2 56
1984-07-23 11:49:00 +00:00
lea 12(sp),sp
bra sys4
_exece: move.l (sp),(a1)
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
_umask: move.l (sp),(a1)
#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)
_chroot: move.l (sp),(a1)
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