Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/list.asm @ 824:4caaf0f992bf
Added source comments, minor improvements
author | boisy |
---|---|
date | Tue, 14 Jan 2003 00:39:54 +0000 |
parents | e9ce43cc215e |
children | 84ea83668304 |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
2 * List - List a text file | |
3 * | |
4 * $Id$ | |
5 * | |
6 * Ed. Comments Who YY/MM/DD | |
7 * ------------------------------------------------------------------ | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
0
diff
changeset
|
8 * 5 From Tandy OS-9 Level One VR 02.00.00 |
0 | 9 |
10 nam List | |
11 ttl List a text file | |
12 | |
13 * Disassembled 98/09/10 23:16:25 by Disasm v1.6 (C) 1988 by RML | |
14 | |
15 ifp1 | |
16 use defsfile | |
17 endc | |
18 | |
19 tylg set Prgrm+Objct | |
20 atrv set ReEnt+rev | |
21 rev set $01 | |
22 edition set 5 | |
23 | |
24 mod eom,name,tylg,atrv,start,size | |
824 | 25 |
26 org 0 | |
27 filepath rmb 1 | |
28 parmptr rmb 2 | |
29 readbuff rmb 650 | |
0 | 30 size equ . |
31 | |
32 name fcs /List/ | |
33 fcb edition | |
34 | |
824 | 35 start stx <parmptr save parameter pointer |
36 lda #READ. read access mode | |
37 os9 I$Open open file | |
38 bcs L0049 branch if error | |
39 sta <filepath else save path to file | |
40 stx <parmptr and updated parm pointer | |
41 L001F lda <filepath get path | |
42 leax readbuff,u point X to read buffer | |
43 ldy #200 read up to 200 bytes | |
44 os9 I$ReadLn read it! | |
45 bcs L0035 branch if error | |
46 lda #1 standard output | |
47 os9 I$WritLn write line to stdout | |
48 bcc L001F branch if ok | |
49 bra L0049 else exit | |
50 L0035 cmpb #E$EOF did we get an EOF error? | |
51 bne L0049 exit if not | |
52 lda <filepath else get path | |
53 os9 I$Close and close it | |
54 bcs L0049 branch if error | |
55 ldx <parmptr get param pointer | |
56 lda ,x get char | |
57 cmpa #C$CR end of command line? | |
58 bne start branch if not | |
59 clrb else clear carry | |
60 L0049 os9 F$Exit and exit | |
0 | 61 |
62 emod | |
63 eom equ * | |
64 end |