Add original unix v6

This commit is contained in:
memnoth
2018-01-27 22:35:41 +09:00
commit 2c7099ee50
664 changed files with 106254 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
/ C library -- wait
/ pid = wait();
/ or,
/ pid = wait(&status);
/
/ pid == -1 if error
/ status indicates fate of process, if given
.globl _wait, _nargs, cerror
_wait:
mov r5,-(sp)
mov sp,r5
jsr pc,_nargs
mov r0,-(sp)
sys wait
bec 1f
tst (sp)+
jmp cerror
1:
tst (sp)+
beq 2f
mov r1,*4(r5) / status return
2:
mov (sp)+,r5
rts pc