.set CCFSZ, 0xc0 /* Torture the register window handling a little. */ .data dstr: .ascii "dad\n" destr: wstr: .ascii "woke up...\n" westr: cstr: .ascii "child\n" cestr: cons: .asciz "/dev/console" rqtp: .int 5 .quad 0 rmtp: .int 0 .quad 0 .text .globl _start _start: mov 5, %g1 ! syscall 5: open setx cons, %l0, %o0 ! file mov 2, %o1 ! O_RDWR mov %g0, %o2 ! mode (unused) ta %xcc, 9 ! syscall mov %o0, %l0 mov 2, %g1 ! syscall 2: fork ta %xcc, 9 ! syscall brz %o0, child mov 4, %g1 ! syscall 4: write mov %l0, %o0 ! file handle setx dstr, %l0, %o1 ! address mov destr - dstr, %o2 ! length ta %xcc, 9 ! syscall mov 240, %g1 ! syscall 240: nanosleep setx rqtp, %l0, %o0 setx rmtp, %l0, %o1 ta %xcc, 9 ! syscall mov 4, %g1 ! syscall 4: write mov %l0, %o0 ! file handle setx wstr, %l0, %o1 ! address mov westr - wstr, %o2 ! length ta %xcc, 9 ! syscall mov 1, %g1 ! syscall 1: exit mov 42, %o0 ta %xcc, 9 child: mov 4, %g1 ! syscall 4: write mov %l0, %o0 ! file handle setx cstr, %l0, %o1 ! address mov cestr - cstr, %o2 ! length ta %xcc, 9 ! syscall mov 1, %g1 ! syscall 1: exit mov 43, %o0 ta %xcc, 9