Added entry points for ANSI C
This commit is contained in:
parent
8fd07efa80
commit
bf95ea8fd9
28 changed files with 609 additions and 1 deletions
|
@ -22,7 +22,6 @@ execl.s
|
||||||
execle.s
|
execle.s
|
||||||
execv.s
|
execv.s
|
||||||
execve.s
|
execve.s
|
||||||
_exit.s
|
|
||||||
fork.s
|
fork.s
|
||||||
fstat.s
|
fstat.s
|
||||||
ftime.s
|
ftime.s
|
||||||
|
@ -62,3 +61,31 @@ utime.s
|
||||||
wait.s
|
wait.s
|
||||||
write.s
|
write.s
|
||||||
errno.s
|
errno.s
|
||||||
|
_alarm.s
|
||||||
|
_brk.s
|
||||||
|
_close.s
|
||||||
|
_creat.s
|
||||||
|
_dup.s
|
||||||
|
_dup2.s
|
||||||
|
_execl.s
|
||||||
|
_execve.s
|
||||||
|
_exit.s
|
||||||
|
_fork.s
|
||||||
|
_fstat.s
|
||||||
|
_ftime.s
|
||||||
|
_getpid.s
|
||||||
|
_gtty.s
|
||||||
|
_ioctl.s
|
||||||
|
_kill.s
|
||||||
|
_link.s
|
||||||
|
_lseek.s
|
||||||
|
_open.s
|
||||||
|
_pause.s
|
||||||
|
_pipe.s
|
||||||
|
_read.s
|
||||||
|
_sbrk.s
|
||||||
|
_stty.s
|
||||||
|
_times.s
|
||||||
|
_unlink.s
|
||||||
|
_wait.s
|
||||||
|
_write.s
|
||||||
|
|
17
mach/ns/libsys/_alarm.s
Normal file
17
mach/ns/libsys/_alarm.s
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
.define __alarm
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __alarm
|
||||||
|
.sect .text
|
||||||
|
__alarm:
|
||||||
|
enter[], 0
|
||||||
|
movd 8(fp),tos
|
||||||
|
movd 27,tos
|
||||||
|
jsr @.mon
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
14
mach/ns/libsys/_brk.s
Normal file
14
mach/ns/libsys/_brk.s
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
.define __brk
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __brk
|
||||||
|
.sect .text
|
||||||
|
__brk:
|
||||||
|
enter[], 0
|
||||||
|
movd 8(fp),@.reghp
|
||||||
|
movd 0,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
11
mach/ns/libsys/_close.s
Normal file
11
mach/ns/libsys/_close.s
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
.define __close
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __close
|
||||||
|
.sect .text
|
||||||
|
__close:
|
||||||
|
movd 0, r4
|
||||||
|
ret 0
|
24
mach/ns/libsys/_creat.s
Normal file
24
mach/ns/libsys/_creat.s
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
.define __creat
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __creat
|
||||||
|
.sect .text
|
||||||
|
__creat:
|
||||||
|
enter[], 0
|
||||||
|
movd 12(fp),tos
|
||||||
|
movd 8(fp),tos
|
||||||
|
movd 8,tos
|
||||||
|
jsr @.mon
|
||||||
|
cmpqd 0,tos
|
||||||
|
beq I0011
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,@_errno
|
||||||
|
movd -1,tos
|
||||||
|
I0011:
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
24
mach/ns/libsys/_dup.s
Normal file
24
mach/ns/libsys/_dup.s
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
.define __dup
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __dup
|
||||||
|
.sect .text
|
||||||
|
__dup:
|
||||||
|
enter[], 0
|
||||||
|
movd 8(fp),tos
|
||||||
|
movd 8(fp),tos
|
||||||
|
movd 41,tos
|
||||||
|
jsr @.mon
|
||||||
|
cmpqd 0,tos
|
||||||
|
beq I0011
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,@_errno
|
||||||
|
movd -1,tos
|
||||||
|
I0011:
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
26
mach/ns/libsys/_dup2.s
Normal file
26
mach/ns/libsys/_dup2.s
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
.define __dup2
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __dup2
|
||||||
|
.sect .text
|
||||||
|
__dup2:
|
||||||
|
enter[], 0
|
||||||
|
movd 8(fp),r7
|
||||||
|
ord 64,r7
|
||||||
|
movd 12(fp),tos
|
||||||
|
movd r7,tos
|
||||||
|
movd 41,tos
|
||||||
|
jsr @.mon
|
||||||
|
cmpqd 0,tos
|
||||||
|
beq I0011
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,@_errno
|
||||||
|
movd -1,tos
|
||||||
|
I0011:
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
20
mach/ns/libsys/_execl.s
Normal file
20
mach/ns/libsys/_execl.s
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
.define __execl
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __execl
|
||||||
|
.sect .text
|
||||||
|
__execl:
|
||||||
|
enter[], 0
|
||||||
|
movd @__penvp,tos
|
||||||
|
addr 12(fp),tos
|
||||||
|
movd 8(fp),tos
|
||||||
|
movd 59,tos
|
||||||
|
jsr @.mon
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,@_errno
|
||||||
|
movd -1,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
24
mach/ns/libsys/_execve.s
Normal file
24
mach/ns/libsys/_execve.s
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
.define __execve
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __execve
|
||||||
|
.sect .text
|
||||||
|
__execve:
|
||||||
|
enter[], 0
|
||||||
|
addr 8(fp),r7
|
||||||
|
movd 12,r0
|
||||||
|
addd r0,r7
|
||||||
|
1:
|
||||||
|
subd 4,r7
|
||||||
|
movd 0(r7),tos
|
||||||
|
acbd -4,r0,1b
|
||||||
|
movd 59,tos
|
||||||
|
jsr @.mon
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,@_errno
|
||||||
|
movd -1,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
27
mach/ns/libsys/_fork.s
Normal file
27
mach/ns/libsys/_fork.s
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
.define __fork
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
__fork:
|
||||||
|
enter[], 0
|
||||||
|
movd 2,tos
|
||||||
|
jsr @.mon
|
||||||
|
cmpqd 0,tos
|
||||||
|
beq I0011
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,@_errno
|
||||||
|
movd -1,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
||||||
|
I0011:
|
||||||
|
cmpqd 0,tos
|
||||||
|
beq I0012
|
||||||
|
movd tos,r7
|
||||||
|
movd 0,tos
|
||||||
|
I0012:
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
25
mach/ns/libsys/_fstat.s
Normal file
25
mach/ns/libsys/_fstat.s
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
.define __fstat
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __fstat
|
||||||
|
.sect .text
|
||||||
|
__fstat:
|
||||||
|
enter[], 0
|
||||||
|
movd 12(fp),tos
|
||||||
|
movd 8(fp),tos
|
||||||
|
movd 28,tos
|
||||||
|
jsr @.mon
|
||||||
|
cmpqd 0,tos
|
||||||
|
bne I0011
|
||||||
|
movd 0,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
||||||
|
I0011:
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,@_errno
|
||||||
|
movd -1,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
15
mach/ns/libsys/_ftime.s
Normal file
15
mach/ns/libsys/_ftime.s
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
.define __ftime
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __ftime
|
||||||
|
.sect .text
|
||||||
|
__ftime:
|
||||||
|
enter[], 0
|
||||||
|
movd 8(fp),tos
|
||||||
|
movd 35,tos
|
||||||
|
jsr @.mon
|
||||||
|
exit []
|
||||||
|
ret 0
|
16
mach/ns/libsys/_getpid.s
Normal file
16
mach/ns/libsys/_getpid.s
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
.define __getpid
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __getpid
|
||||||
|
.sect .text
|
||||||
|
__getpid:
|
||||||
|
enter[], 0
|
||||||
|
movd 20,tos
|
||||||
|
jsr @.mon
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
17
mach/ns/libsys/_gtty.s
Normal file
17
mach/ns/libsys/_gtty.s
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
.define __gtty
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __gtty
|
||||||
|
.sect .text
|
||||||
|
__gtty:
|
||||||
|
enter[], 0
|
||||||
|
movd 12(fp),tos
|
||||||
|
movd 29704,tos
|
||||||
|
movd 8(fp),tos
|
||||||
|
jsr @__ioctl
|
||||||
|
adjspd -12
|
||||||
|
exit []
|
||||||
|
ret 0
|
30
mach/ns/libsys/_ioctl.s
Normal file
30
mach/ns/libsys/_ioctl.s
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
.define __ioctl
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __ioctl
|
||||||
|
.sect .text
|
||||||
|
__ioctl:
|
||||||
|
enter[], 0
|
||||||
|
addr 8(fp),r7
|
||||||
|
movd 12,r0
|
||||||
|
addd r0,r7
|
||||||
|
1:
|
||||||
|
subd 4,r7
|
||||||
|
movd 0(r7),tos
|
||||||
|
acbd -4,r0,1b
|
||||||
|
movd 54,tos
|
||||||
|
jsr @.mon
|
||||||
|
cmpqd 0,tos
|
||||||
|
bne I0011
|
||||||
|
movd 0,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
||||||
|
I0011:
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,@_errno
|
||||||
|
movd -1,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
25
mach/ns/libsys/_kill.s
Normal file
25
mach/ns/libsys/_kill.s
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
.define __kill
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __kill
|
||||||
|
.sect .text
|
||||||
|
__kill:
|
||||||
|
enter[], 0
|
||||||
|
movd 12(fp),tos
|
||||||
|
movd 8(fp),tos
|
||||||
|
movd 37,tos
|
||||||
|
jsr @.mon
|
||||||
|
cmpqd 0,tos
|
||||||
|
bne I0011
|
||||||
|
movd 0,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
||||||
|
I0011:
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,@_errno
|
||||||
|
movd -1,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
25
mach/ns/libsys/_link.s
Normal file
25
mach/ns/libsys/_link.s
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
.define __link
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __link
|
||||||
|
.sect .text
|
||||||
|
__link:
|
||||||
|
enter[], 0
|
||||||
|
movd 12(fp),tos
|
||||||
|
movd 8(fp),tos
|
||||||
|
movd 9,tos
|
||||||
|
jsr @.mon
|
||||||
|
cmpqd 0,tos
|
||||||
|
bne I0011
|
||||||
|
movd 0,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
||||||
|
I0011:
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,@_errno
|
||||||
|
movd -1,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
29
mach/ns/libsys/_lseek.s
Normal file
29
mach/ns/libsys/_lseek.s
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
.define __lseek
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __lseek
|
||||||
|
.sect .text
|
||||||
|
__lseek:
|
||||||
|
enter[], 0
|
||||||
|
addr 8(fp),r7
|
||||||
|
movd 16,r0
|
||||||
|
addd r0,r7
|
||||||
|
1:
|
||||||
|
subd 4,r7
|
||||||
|
movd 0(r7),tos
|
||||||
|
acbd -4,r0,1b
|
||||||
|
movd 19,tos
|
||||||
|
jsr @.mon
|
||||||
|
cmpqd 0,tos
|
||||||
|
beq I0011
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,@_errno
|
||||||
|
movd -1,tos
|
||||||
|
I0011:
|
||||||
|
movd tos,r4
|
||||||
|
movd tos,r5
|
||||||
|
exit []
|
||||||
|
ret 0
|
24
mach/ns/libsys/_open.s
Normal file
24
mach/ns/libsys/_open.s
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
.define __open
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __open
|
||||||
|
.sect .text
|
||||||
|
__open:
|
||||||
|
enter[], 0
|
||||||
|
movd 12(fp),tos
|
||||||
|
movd 8(fp),tos
|
||||||
|
movd 5,tos
|
||||||
|
jsr @.mon
|
||||||
|
cmpqd 0,tos
|
||||||
|
beq I0011
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,@_errno
|
||||||
|
movd -1,tos
|
||||||
|
I0011:
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
14
mach/ns/libsys/_pause.s
Normal file
14
mach/ns/libsys/_pause.s
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
.define __pause
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __pause
|
||||||
|
.sect .text
|
||||||
|
__pause:
|
||||||
|
enter[], 0
|
||||||
|
movd 29,tos
|
||||||
|
jsr @.mon
|
||||||
|
exit []
|
||||||
|
ret 0
|
28
mach/ns/libsys/_pipe.s
Normal file
28
mach/ns/libsys/_pipe.s
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
.define __pipe
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __pipe
|
||||||
|
.sect .text
|
||||||
|
__pipe:
|
||||||
|
enter[], 0
|
||||||
|
movd 42,tos
|
||||||
|
jsr @.mon
|
||||||
|
cmpqd 0,tos
|
||||||
|
beq I0011
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,@_errno
|
||||||
|
movd -1,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
||||||
|
I0011:
|
||||||
|
movd 8(fp),r7
|
||||||
|
movd tos,r6
|
||||||
|
movd r6,4(r7)
|
||||||
|
movd tos,r6
|
||||||
|
movd r6,0(8(fp))
|
||||||
|
movd 0,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
20
mach/ns/libsys/_read.s
Normal file
20
mach/ns/libsys/_read.s
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
.define __read
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __read
|
||||||
|
.sect .text
|
||||||
|
__read:
|
||||||
|
enter[], 0
|
||||||
|
save [r0,r1,r2,r3]
|
||||||
|
movd 3,r0
|
||||||
|
movd 12(fp),r1
|
||||||
|
movd 16(fp),r2
|
||||||
|
movd 0,r3
|
||||||
|
svc
|
||||||
|
movd 16(fp),r4
|
||||||
|
restore [r0,r1,r2,r3]
|
||||||
|
exit[]
|
||||||
|
ret 0
|
16
mach/ns/libsys/_sbrk.s
Normal file
16
mach/ns/libsys/_sbrk.s
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
.define __sbrk
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __sbrk
|
||||||
|
.sect .text
|
||||||
|
__sbrk:
|
||||||
|
enter[], 0
|
||||||
|
movd @.reghp,r7
|
||||||
|
addd 8(fp),r7
|
||||||
|
movd r7,@.reghp
|
||||||
|
movd @.reghp,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
17
mach/ns/libsys/_stty.s
Normal file
17
mach/ns/libsys/_stty.s
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
.define __stty
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __stty
|
||||||
|
.sect .text
|
||||||
|
__stty:
|
||||||
|
enter[], 0
|
||||||
|
movd 12(fp),tos
|
||||||
|
movd 29705,tos
|
||||||
|
movd 8(fp),tos
|
||||||
|
jsr @__ioctl
|
||||||
|
adjspd -12
|
||||||
|
exit []
|
||||||
|
ret 0
|
15
mach/ns/libsys/_times.s
Normal file
15
mach/ns/libsys/_times.s
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
.define __times
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __times
|
||||||
|
.sect .text
|
||||||
|
__times:
|
||||||
|
enter[], 0
|
||||||
|
movd 8(fp),tos
|
||||||
|
movd 43,tos
|
||||||
|
jsr @.mon
|
||||||
|
exit []
|
||||||
|
ret 0
|
24
mach/ns/libsys/_unlink.s
Normal file
24
mach/ns/libsys/_unlink.s
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
.define __unlink
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __unlink
|
||||||
|
.sect .text
|
||||||
|
__unlink:
|
||||||
|
enter[], 0
|
||||||
|
movd 8(fp),tos
|
||||||
|
movd 10,tos
|
||||||
|
jsr @.mon
|
||||||
|
cmpqd 0,tos
|
||||||
|
bne I0011
|
||||||
|
movd 0,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
||||||
|
I0011:
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,@_errno
|
||||||
|
movd -1,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
34
mach/ns/libsys/_wait.s
Normal file
34
mach/ns/libsys/_wait.s
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
.define __wait
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __wait
|
||||||
|
.sect .text
|
||||||
|
__wait:
|
||||||
|
enter[], 0
|
||||||
|
movd 7,tos
|
||||||
|
jsr @.mon
|
||||||
|
cmpqd 0,tos
|
||||||
|
bne I0011
|
||||||
|
cmpqd 0,8(fp)
|
||||||
|
beq I0012
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,0(8(fp))
|
||||||
|
movd tos,r6
|
||||||
|
movd r6,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
||||||
|
I0012:
|
||||||
|
adjspd -4
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
||||||
|
I0011:
|
||||||
|
movd tos,r7
|
||||||
|
movd r7,@_errno
|
||||||
|
movd -1,r4
|
||||||
|
exit []
|
||||||
|
ret 0
|
20
mach/ns/libsys/_write.s
Normal file
20
mach/ns/libsys/_write.s
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
.define __write
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
.extern __write
|
||||||
|
.sect .text
|
||||||
|
__write:
|
||||||
|
enter[], 0
|
||||||
|
save [r0,r1,r2,r3]
|
||||||
|
movd 4,r0
|
||||||
|
movd 12(fp),r1
|
||||||
|
movd 16(fp),r2
|
||||||
|
movd 0,r3
|
||||||
|
svc
|
||||||
|
movd 16(fp),r4
|
||||||
|
restore [r0,r1,r2,r3]
|
||||||
|
exit[]
|
||||||
|
ret 0
|
Loading…
Reference in a new issue