2 ; Oliver Schmidt, 12.01.2005
4 ; int __fastcall__ read (int fd, void* buf, unsigned count);
7 .constructor initprompt
9 .import rwprolog, rwcommon
12 .include "zeropage.inc"
16 .include "filedes.inc"
22 ; Set prompt <> ']' to let DOS 3.3 know that we're
23 ; not in Applesoft immediate mode and thus keep it
24 ; from scanning our device I/O for DOS commands.
25 lda #$80 ; Same value used at $D52C
37 ; Check for read access
38 lda fdtab + FD::FLAGS,y
55 ; Check for zero count
60 ; Read from device and echo to device
64 ; Clear hi bit and check for '\r'
69 ; Replace with '\n' and set count to zero
89 ; Check for counter less than count
97 ; Return success, AX already set
104 errno: jmp __directerrno