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
50 ; Device succeeds always
58 ; Check for zero count
63 ; Read from device and echo to device
67 ; Clear hi bit and check for '\r'
72 ; Replace with '\n' and set count to zero
92 ; Check for counter less than count
100 ; Return success, AX already set
107 errno: jmp __directerrno