annotate level1/cmds/megaread.asm @ 2465:0dbf98106f31

fix rfm writeln
author aaronwolfe
date Sat, 27 Feb 2010 23:13:47 +0000
parents d5b309f1983f
children 0b7321633fe9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2196
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
1 ***********************************************************************
1542
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
2 * MegaRead - Disk Performance Utility
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
3 * $Id$
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
4 *
1544
e548e2df2006 Megaread fixed by Rodney
boisy
parents: 1543
diff changeset
5 * Modified from an original program by Caveh Jalali
1542
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
7 * Comment
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
8 * ------------------------------------------------------------------
1544
e548e2df2006 Megaread fixed by Rodney
boisy
parents: 1543
diff changeset
9 * 01/01 1987/05/30 Bruce Isted (CIS PPN 76625,2273)
e548e2df2006 Megaread fixed by Rodney
boisy
parents: 1543
diff changeset
10 * Released to the public domain
1542
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
11 *
1544
e548e2df2006 Megaread fixed by Rodney
boisy
parents: 1543
diff changeset
12 * 01/00 2004/04/22 Boisy G. Pitre
e548e2df2006 Megaread fixed by Rodney
boisy
parents: 1543
diff changeset
13 * Ported to NitrOS-9 style, no error on exit
e548e2df2006 Megaread fixed by Rodney
boisy
parents: 1543
diff changeset
14 *
e548e2df2006 Megaread fixed by Rodney
boisy
parents: 1543
diff changeset
15 * 01/01 2004/04/22 Rodney V. Hamilton
e548e2df2006 Megaread fixed by Rodney
boisy
parents: 1543
diff changeset
16 * Added EOF check for floppy
2196
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
17 *
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
18 * 01/02 2009/03/14 Bob Devries
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
19 * Added functionality to read a number of 1K blocks as specified on the command line.
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
20 * Command line is now: megaread #####
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
21 * where ##### is the number of 1K blocks to read; default 1024
1528
1c5a50add566 Megaread added
boisy
parents:
diff changeset
22
1542
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
23 nam MegaRead
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
24 ttl Disk Performance Utilty
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
25
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
26 IFP1
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
27 use defsfile
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
28 ENDC
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
29
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
30 tylg set Prgrm+Objct
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
31 atrv set ReEnt+rev
2196
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
32 rev set $02
1542
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
33 edition set 1
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
34
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
35 ReadK equ 1024 1024K is 1 megabyte (modify as desired)
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
36
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
37 mod eom,name,tylg,atrv,start,size
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
38
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
39 org 0
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
40 KiloBuff rmb $0400
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
41 rmb 200 stack space
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
42 size equ .
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
43
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
44 name fcs /MegaRead/
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
45 fcb edition
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
46
2196
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
47 start clra
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
48 clrb
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
49 bsr dec2bin read a character from command line and convert to binary
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
50 bsr dec2bin
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
51 bsr dec2bin
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
52 bsr dec2bin
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
53 bsr dec2bin
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
54 ldx #ReadK seed X with value for 1 meg read
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
55 cmpd #0 is command line number given?
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
56 beq loop no, so use default (in X)
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
57 tfr d,x yes, use it
1542
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
58 loop pshs x save counter
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
59 leax KiloBuff,u point (X) to buffer
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
60 ldy #$0400 read 1K
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
61 clra std input
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
62 os9 I$Read
1544
e548e2df2006 Megaread fixed by Rodney
boisy
parents: 1543
diff changeset
63 bcs eofchk
1542
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
64 puls x recover counter
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
65 leax -1,x done yet?
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
66 bne loop no, go get another 1K
1544
e548e2df2006 Megaread fixed by Rodney
boisy
parents: 1543
diff changeset
67 bra exitok yes, exit
1554
d73d05da6483 Rodney fixed slight bug
boisy
parents: 1544
diff changeset
68 eofchk cmpb #E$EOF end of media?
1544
e548e2df2006 Megaread fixed by Rodney
boisy
parents: 1543
diff changeset
69 bne exit no, a real error
e548e2df2006 Megaread fixed by Rodney
boisy
parents: 1543
diff changeset
70 exitok clrb
2196
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
71 exit os9 F$Exit
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
72 dec2bin pshs b,a
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
73 ldb ,x get char from command line at X
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
74 subb #$30 convert decimal char to binary
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
75 bcs exd2b exit if < 0
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
76 cmpb #$09
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
77 bhi exd2b or > 9
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
78 leax 1,x bump cmd line pointer
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
79 pshs b save cmd line character
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
80 ldb #$0a
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
81 mul multiply by 10
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
82 stb 1,s
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
83 lda 2,s
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
84 ldb #$0a
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
85 mul
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
86 addb ,s+
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
87 adca ,s
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
88 std ,s
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
89 exd2b puls pc,b,a
1544
e548e2df2006 Megaread fixed by Rodney
boisy
parents: 1543
diff changeset
90
1542
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
91 emod
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
92 eom equ *
16d293af795b Obtained megaread source from RTSI
boisy
parents: 1528
diff changeset
93 end
2196
d5b309f1983f Updates by Bob
boisy
parents: 1554
diff changeset
94