-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathiotest1.mms
36 lines (33 loc) · 1.1 KB
/
iotest1.mms
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
* 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