2 ; jede jede@oric.org 2017-01-22
6 .importzp ptr1, ptr2, ptr3, tmp1
8 .include "telestrat.inc"
10 ; int write (int fd, const void* buf, int count);
14 stx ptr3+1 ; save count as result
20 sta ptr2+1 ; Remember -count-1
23 jsr popax ; get fd and discard
25 ; if fd=0001 then it stdout
33 ; Here it's a file opened
51 cpx #$0A ; Check for \n
53 BRK_TELEMON XWR0 ; Macro send char to screen (channel 0 in telemon terms)
54 lda #$0D ; return to the beggining of the line
55 BRK_TELEMON XWR0 ; Macro ;
60 BRK_TELEMON XWR0 ; Macro
67 ; No error, return count