next up previous
Next: syscall Definitions Up: Ultrix System Procedures Previous: Example: C I/O

Example: MAL I/O

In this example, the C language program from the preceding section is compiled to produce the MAL code in the file test.s.

Examination of the MAL code reveals that the procedure calling conventions are observed when passing parameters to the system procedures prior to the jal instructions. The read() and write() functions, like all Unix system procedures, return a value in $2 ($v0).

The MAL code is then assembled to produce the executable file a.out.




CS301 Class Account
Thu Dec 12 23:09:15 AST 1996