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