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
|
1528
|
22
|
1542
|
23 nam MegaRead
|
|
24 ttl Disk Performance Utilty
|
|
25
|
|
26 IFP1
|
|
27 use defsfile
|
|
28 ENDC
|
|
29
|
|
30 tylg set Prgrm+Objct
|
|
31 atrv set ReEnt+rev
|
2196
|
32 rev set $02
|
1542
|
33 edition set 1
|
|
34
|
|
35 ReadK equ 1024 1024K is 1 megabyte (modify as desired)
|
|
36
|
|
37 mod eom,name,tylg,atrv,start,size
|
|
38
|
|
39 org 0
|
|
40 KiloBuff rmb $0400
|
|
41 rmb 200 stack space
|
|
42 size equ .
|
|
43
|
|
44 name fcs /MegaRead/
|
|
45 fcb edition
|
|
46
|
2196
|
47 start clra
|
|
48 clrb
|
|
49 bsr dec2bin read a character from command line and convert to binary
|
|
50 bsr dec2bin
|
|
51 bsr dec2bin
|
|
52 bsr dec2bin
|
|
53 bsr dec2bin
|
|
54 ldx #ReadK seed X with value for 1 meg read
|
|
55 cmpd #0 is command line number given?
|
|
56 beq loop no, so use default (in X)
|
|
57 tfr d,x yes, use it
|
1542
|
58 loop pshs x save counter
|
|
59 leax KiloBuff,u point (X) to buffer
|
|
60 ldy #$0400 read 1K
|
|
61 clra std input
|
|
62 os9 I$Read
|
1544
|
63 bcs eofchk
|
1542
|
64 puls x recover counter
|
|
65 leax -1,x done yet?
|
|
66 bne loop no, go get another 1K
|
1544
|
67 bra exitok yes, exit
|
1554
|
68 eofchk cmpb #E$EOF end of media?
|
1544
|
69 bne exit no, a real error
|
|
70 exitok clrb
|
2196
|
71 exit os9 F$Exit
|
|
72 dec2bin pshs b,a
|
|
73 ldb ,x get char from command line at X
|
|
74 subb #$30 convert decimal char to binary
|
|
75 bcs exd2b exit if < 0
|
|
76 cmpb #$09
|
|
77 bhi exd2b or > 9
|
|
78 leax 1,x bump cmd line pointer
|
|
79 pshs b save cmd line character
|
|
80 ldb #$0a
|
|
81 mul multiply by 10
|
|
82 stb 1,s
|
|
83 lda 2,s
|
|
84 ldb #$0a
|
|
85 mul
|
|
86 addb ,s+
|
|
87 adca ,s
|
|
88 std ,s
|
|
89 exd2b puls pc,b,a
|
1544
|
90
|
1542
|
91 emod
|
|
92 eom equ *
|
|
93 end
|
2196
|
94
|