* TESTING I/O (besides what was tested by the copy program)
* (intended for online test)

t        IS   $255
Buf      IS   Data_Segment+2
         LOC  Buf+9*2
Arg0     OCTA Buf,9
Arg1     OCTA Filename,BinaryReadWrite
         LOC  @+1
Filename BYTE "iotest.tmp",0
         GREG Buf
      
         LOC  #200
Main     LDA  t,Arg0
         TRAP 0,Fgets,StdIn     Fgets(StdIn,Buf,9)
         LDA  t,Buf
         TRAP 0,Fputs,StdOut    Fputs(StdOut,Buf)
         LDA  t,Arg0
         TRAP 0,Fgetws,StdIn    Fgetws(StdIn,Buf,9)
         LDA  t,Buf
         TRAP 0,Fputws,StdOut   Fputws(StdOut,Buf)
         TRAP 0,Fclose,StdIn    Fclose(StdIn)
         TRAP 0,Fclose,StdIn    Fclose(StdIn)
         LDA  t,Arg1
         TRAP 0,Fopen,StdIn     Fopen(StdIn,"iotest.tmp",BinaryReadWrite)
         NEG  t,1
         TRAP 0,Fseek,StdIn     Fseek(StdIn,-1)
         TRAP 0,Ftell,StdIn     Ftell(StdIn)
         LDA  t,Buf
         TRAP 0,Fputws,StdIn    Fputws(StdIn,Buf)
         SET  t,2
         TRAP 0,Fseek,StdIn     Fseek(StdIn,2)
         LDA  t,Arg0
         TRAP 0,Fgets,StdIn     Fgets(StdIn,Buf,9)
         TRAP 0,Halt,0

