2196
|
1 ***********************************************************************
|
1542
|
2 * MegaRead - Disk Performance Utility
|
|
3 * $Id$
|
|
4 *
|
1544
|
5 * Modified from an original program by Caveh Jalali
|
1542
|
6 * Edt/Rev YYYY/MM/DD Modified by
|
|
7 * Comment
|
|
8 * ------------------------------------------------------------------
|
1544
|
9 * 01/01 1987/05/30 Bruce Isted (CIS PPN 76625,2273)
|
|
10 * Released to the public domain
|
1542
|
11 *
|
1544
|
12 * 01/00 2004/04/22 Boisy G. Pitre
|
|
13 * Ported to NitrOS-9 style, no error on exit
|
|
14 *
|
|
15 * 01/01 2004/04/22 Rodney V. Hamilton
|
|
16 * Added EOF check for floppy
|
2196
|
17 *
|
|
18 * 01/02 2009/03/14 Bob Devries
|
|
19 * Added functionality to read a number of 1K blocks as specified on the command line.
|
|
20 * Command line is now: megaread #####
|
|
21 * where ##### is the number of 1K blocks to read; default 1024
|
2540
|
22 *
|
|
23 * 01/02 2010/05/22 Boisy G. Pitre
|
|
24 * Made source more configurable in terms of read chunk size and total read count
|
1528
|
25
|
1542
|
26 nam MegaRead
|
|
27 ttl Disk Performance Utilty
|
|
28
|
|
29 IFP1
|
|
30 use defsfile
|
|
31 ENDC
|
|
32
|
|
33 tylg set Prgrm+Objct
|
|
34 atrv set ReEnt+rev
|
2196
|
35 rev set $02
|
1542
|
36 edition set 1
|
|
37
|
2540
|
38 ChunkSz equ 1024
|
|
39 ChnkCnt equ 1024^2/ChunkSz 1024^2 is 1 megabyte (modify as desired)
|
1542
|
40
|
|
41 mod eom,name,tylg,atrv,start,size
|
|
42
|
|
43 org 0
|
2540
|
44 StartTm rmb 5
|
|
45 EndTm rmb 5
|
|
46 KiloBuff rmb ChunkSz
|
1542
|
47 rmb 200 stack space
|
|
48 size equ .
|
|
49
|
|
50 name fcs /MegaRead/
|
|
51 fcb edition
|
|
52
|
2196
|
53 start clra
|
|
54 clrb
|
|
55 bsr dec2bin read a character from command line and convert to binary
|
|
56 bsr dec2bin
|
|
57 bsr dec2bin
|
|
58 bsr dec2bin
|
|
59 bsr dec2bin
|
2540
|
60 * capture start time
|
|
61 leax StartTm,u
|
|
62 os9 F$Time
|
|
63 ldx #ChnkCnt seed X with count value to read target size
|
2196
|
64 cmpd #0 is command line number given?
|
|
65 beq loop no, so use default (in X)
|
|
66 tfr d,x yes, use it
|
1542
|
67 loop pshs x save counter
|
|
68 leax KiloBuff,u point (X) to buffer
|
2540
|
69 ldy #ChunkSz read predetermined chunk
|
1542
|
70 clra std input
|
|
71 os9 I$Read
|
1544
|
72 bcs eofchk
|
1542
|
73 puls x recover counter
|
|
74 leax -1,x done yet?
|
2540
|
75 bne loop no, go get another chunk
|
|
76 bra fini yes, exit
|
1554
|
77 eofchk cmpb #E$EOF end of media?
|
1544
|
78 bne exit no, a real error
|
2540
|
79
|
|
80 * capture end time
|
|
81 fini
|
|
82 leax EndTm,u
|
|
83 os9 F$Time
|
|
84
|
|
85 * calculate difference and report
|
|
86
|
|
87 clrb
|
2196
|
88 exit os9 F$Exit
|
2540
|
89
|
2196
|
90 dec2bin pshs b,a
|
|
91 ldb ,x get char from command line at X
|
|
92 subb #$30 convert decimal char to binary
|
|
93 bcs exd2b exit if < 0
|
|
94 cmpb #$09
|
|
95 bhi exd2b or > 9
|
|
96 leax 1,x bump cmd line pointer
|
|
97 pshs b save cmd line character
|
|
98 ldb #$0a
|
|
99 mul multiply by 10
|
|
100 stb 1,s
|
|
101 lda 2,s
|
|
102 ldb #$0a
|
|
103 mul
|
|
104 addb ,s+
|
|
105 adca ,s
|
|
106 std ,s
|
|
107 exd2b puls pc,b,a
|
1544
|
108
|
1542
|
109 emod
|
|
110 eom equ *
|
|
111 end
|
2196
|
112
|