OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [fp/] [implementation/] [mmix/] [iotest1.mms] - Rev 221

Go to most recent revision | Compare with Previous | Blame | View Log

* 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

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.