1: .data 2: / C library -- wait 3: 4: / pid = wait(&status); 5: / 6: / pid == -1 if error 7: / status indicates fate of process 8: 9: .globl _wait, cerror 10: 11: _wait: 12: mov r5,-(sp) 13: mov sp,r5 14: sys wait 15: bec 1f 16: jmp cerror 17: 1: 18: mov r1,*4(r5) / status return 19: mov (sp)+,r5 20: rts pc