Research V2 development
authorDennis Ritchie <dmr@research.uucp>
Mon, 5 Jun 1972 22:39:23 +0000 (17:39 -0500)
committerDennis Ritchie <dmr@research.uucp>
Mon, 5 Jun 1972 22:39:23 +0000 (17:39 -0500)
Work on file lib/read.s

Synthesized-from: v2

lib/read.s [new file with mode: 0644]

diff --git a/lib/read.s b/lib/read.s
new file mode 100644 (file)
index 0000000..d19129f
--- /dev/null
@@ -0,0 +1,22 @@
+/ C library -- read
+
+/ nread = read(file, buffer, count);
+/
+/ nread ==0 means eof; nread == -1 means error
+
+       .globl  _read
+
+.data
+_read:
+       1f
+.text
+1:
+       mov     2(sp),r0
+       mov     4(sp),0f
+       mov     6(sp),0f+2
+       sys     read; 0:..; ..
+       bec     1f
+       mov     $-1,r0
+1:
+       rts     pc
+