annotate level1/cmds/list.asm @ 2017:f273e28ea8d0

Breaking kernel down into individual files... added comments
author boisy
date Tue, 07 Mar 2006 12:20:16 +0000
parents 84ea83668304
children
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 *
1325
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 824
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 824
diff changeset
7 * Comment
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
1325
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 824
diff changeset
9 * 5 ????/??/??
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 824
diff changeset
10 * From Tandy OS-9 Level One VR 02.00.00.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12 nam List
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13 ttl List a text file
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15 * Disassembled 98/09/10 23:16:25 by Disasm v1.6 (C) 1988 by RML
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21 tylg set Prgrm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 atrv set ReEnt+rev
1325
84ea83668304 Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents: 824
diff changeset
23 rev set $00
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 edition set 5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26 mod eom,name,tylg,atrv,start,size
824
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
27
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
28 org 0
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
29 filepath rmb 1
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
30 parmptr rmb 2
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
31 readbuff rmb 650
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34 name fcs /List/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 fcb edition
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36
824
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
37 start stx <parmptr save parameter pointer
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
38 lda #READ. read access mode
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
39 os9 I$Open open file
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
40 bcs L0049 branch if error
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
41 sta <filepath else save path to file
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
42 stx <parmptr and updated parm pointer
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
43 L001F lda <filepath get path
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
44 leax readbuff,u point X to read buffer
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
45 ldy #200 read up to 200 bytes
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
46 os9 I$ReadLn read it!
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
47 bcs L0035 branch if error
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
48 lda #1 standard output
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
49 os9 I$WritLn write line to stdout
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
50 bcc L001F branch if ok
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
51 bra L0049 else exit
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
52 L0035 cmpb #E$EOF did we get an EOF error?
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
53 bne L0049 exit if not
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
54 lda <filepath else get path
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
55 os9 I$Close and close it
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
56 bcs L0049 branch if error
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
57 ldx <parmptr get param pointer
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
58 lda ,x get char
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
59 cmpa #C$CR end of command line?
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
60 bne start branch if not
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
61 clrb else clear carry
4caaf0f992bf Added source comments, minor improvements
boisy
parents: 200
diff changeset
62 L0049 os9 F$Exit and exit
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
64 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
65 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 end