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
25 jsr popax ; get fd and discard
27 ; if fd=0001 then it stdout
37 ; Here it's a file opened
55 cpx #$0A ; Check for \n
57 BRK_TELEMON XWR0 ; Macro send char to screen (channel 0 in telemon terms)
58 lda #$0D ; return to the beggining of the line
59 BRK_TELEMON XWR0 ; Macro ;
64 BRK_TELEMON XWR0 ; Macro
71 ; No error, return count