2 ; Ullrich von Bassewitz, 2003-04-13
4 ; int write (int fd, const void* buf, int count);
6 ; This function is a hack!
11 .importzp ptr1, ptr2, ptr3, tmp1
13 .include "telemon30.inc"
18 stx ptr3+1 ; save count as result
24 sta ptr2+1 ; Remember -count-1
29 jsr popax ; get fd and discard
31 ; if fd=0001 then it stdout
41 ; Here it's a file opened
59 cpx #$0A ; Check for \n
61 BRK_TELEMON XWR0 ; Macro
62 lda #$0d ; return to the beggining of the line
63 BRK_TELEMON XWR0 ; Macro ;
68 BRK_TELEMON XWR0 ; Macro
75 ; No error, return count