Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/mfree.asm @ 2798:b70d93f8d7ce lwtools-port
Updated coco1/modules/makefile and coco3/modules/makefile to help resolve issues with i(x) and s(x) descriptors.
Updated level1/coco1/modules/makefile & level2/coco3/modules/makefile
so that correct values would be sent to assembler when
building superdesc.asm for s(x).dd and i(x).dd descriptors.
author | drencor-xeen |
---|---|
date | Mon, 28 Jan 2013 16:13:05 -0600 |
parents | 84ea83668304 |
children |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
15 | 2 * Mfree - Show free memory |
0 | 3 * |
4 * $Id$ | |
5 * | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
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:
924
diff
changeset
|
7 * Comment |
0 | 8 * ------------------------------------------------------------------ |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
9 * 5 ????/??/?? |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
10 * From Tandy OS-9 Level One VR 02.00.00. |
0 | 11 |
12 nam Mfree | |
15 | 13 ttl Show free memory |
0 | 14 |
15 | 15 * Disassembled 02/04/05 15:22:05 by Disasm v1.6 (C) 1988 by RML |
0 | 16 |
17 ifp1 | |
15 | 18 use defsfile |
0 | 19 endc |
15 | 20 |
0 | 21 tylg set Prgrm+Objct |
22 atrv set ReEnt+rev | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
23 rev set $00 |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
90
diff
changeset
|
24 edition set 5 |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
25 stdout set 1 |
15 | 26 |
0 | 27 mod eom,name,tylg,atrv,start,size |
15 | 28 |
924 | 29 org 0 |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
30 fmbegin rmb 2 |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
31 fmend rmb 2 |
0 | 32 u0004 rmb 1 |
33 u0005 rmb 1 | |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
34 upper rmb 2 Upper boundary of free segment |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
35 lower rmb 2 Lower boundary of free segment |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
36 pages rmb 1 |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
37 bufptr rmb 2 |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
38 buffer rmb 530 |
0 | 39 size equ . |
15 | 40 |
41 name fcs /Mfree/ | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
90
diff
changeset
|
42 fcb edition |
15 | 43 |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
44 header fcb C$LF |
15 | 45 fcc " Address pages" |
46 fcb C$LF | |
47 fcc "--------- -----" | |
48 fcb $80+C$CR | |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
49 totfree fcb C$LF |
15 | 50 fcs "Total pages free = " |
51 L0048 fcs "Graphics Memory " | |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
52 notalloc fcs "Not Allocated" |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
53 ataddr fcs "at: $" |
15 | 54 |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
55 start leay buffer,u |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
56 sty <bufptr |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
57 leay <header,pcr |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
58 bsr ApndStr |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
59 bsr print |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
60 ldx >D.FMBM The free memory bitmap pointer start |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
61 stx <fmbegin |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
62 ldx >D.FMBM+2 The free memory bitmap pointer end |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
63 stx <fmend |
0 | 64 clra |
65 clrb | |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
66 sta <u0005 Clear |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
67 std <upper Clear |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
68 std <lower Clear |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
69 stb <pages Clear |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
70 ldx <fmbegin |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
71 nextbyte lda ,x+ |
0 | 72 bsr L00A8 |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
73 cmpx <fmend |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
74 bcs nextbyte |
0 | 75 bsr L00B8 |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
76 leay <totfree,pcr |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
77 bsr ApndStr |
0 | 78 ldb <u0005 |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
79 bsr bDeci |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
80 bsr print |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
81 lbsr display |
0 | 82 clrb |
83 os9 F$Exit | |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
84 * |
0 | 85 L00A8 bsr L00AA |
86 L00AA bsr L00AC | |
87 L00AC bsr L00AE | |
88 L00AE lsla | |
89 bcs L00B8 | |
90 inc <u0005 | |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
91 inc <pages |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
92 inc <upper |
0 | 93 rts |
94 L00B8 pshs b,a | |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
95 ldb <pages |
0 | 96 beq L00D7 |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
97 ldd <lower |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
98 bsr dHexa |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
99 lda #$2D '-' char |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
100 bsr ApndA |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
101 ldd <upper |
0 | 102 subd #$0001 |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
103 bsr dHexa |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
104 bsr aspace Append a space to buffer |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
105 bsr aspace Append a space to buffer |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
106 ldb <pages |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
107 bsr bDeci |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
108 bsr print |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
109 L00D7 inc <upper |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
110 ldd <upper |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
111 std <lower |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
112 clr <pages |
0 | 113 puls pc,b,a |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
114 * |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
115 * Append string (in reg y) to buffer |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
116 * |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
117 ApndStr lda ,y |
0 | 118 anda #$7F |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
119 bsr ApndA |
0 | 120 lda ,y+ |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
121 bpl ApndStr |
0 | 122 rts |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
123 * |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
124 * Print the buffer |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
125 * |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
126 print pshs y,x,a |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
127 lda #C$CR Add form feed to buffer |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
128 bsr ApndA |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
129 leax buffer,u Reset bufptr to start of buffer |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
130 stx <bufptr |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
131 ldy #80 Max line length = 80 |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
132 lda #stdout |
0 | 133 os9 I$WritLn |
134 puls pc,y,x,a | |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
135 * |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
136 * Appends the content of register B in decimal |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
137 * to the buffer |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
138 * |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
139 bDeci lda #$FF |
0 | 140 clr <u0004 |
141 L0105 inca | |
142 subb #$64 | |
143 bcc L0105 | |
144 bsr L0119 | |
145 lda #$0A | |
146 L010E deca | |
147 addb #$0A | |
148 bcc L010E | |
149 bsr L0119 | |
150 tfr b,a | |
151 inc <u0004 | |
152 L0119 tsta | |
153 beq L011E | |
154 sta <u0004 | |
155 L011E tst <u0004 | |
156 bne L0124 | |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
157 aspace lda #$F0 |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
158 L0124 adda #$30 Offset to "0" in ascii table |
0 | 159 cmpa #$3A |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
160 bcs ApndA |
0 | 161 adda #$07 |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
162 * |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
163 * Append character (in a) to buffer |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
164 * |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
165 ApndA pshs x |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
166 ldx <bufptr |
0 | 167 sta ,x+ |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
168 stx <bufptr |
0 | 169 puls pc,x |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
170 * |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
171 * Append register D as hex string to buffer |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
172 * |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
173 dHexa clr <u0004 |
0 | 174 bsr L013C |
175 tfr b,a | |
176 L013C pshs a | |
177 lsra | |
178 lsra | |
179 lsra | |
180 lsra | |
181 bsr L0146 | |
182 puls a | |
183 L0146 anda #$0F | |
184 bra L0119 | |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
185 display pshs y,x |
0 | 186 leay >L0048,pcr |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
187 bsr ApndStr |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
188 lda #stdout |
15 | 189 ldb #SS.DStat |
0 | 190 os9 I$GetStt |
191 bcc L0163 | |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
192 leay >notalloc,pcr |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
193 bsr ApndStr |
0 | 194 bra L016E |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
195 L0163 leay >ataddr,pcr |
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
196 lbsr ApndStr |
0 | 197 tfr x,d |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
198 bsr dHexa |
0 | 199 L016E puls y,x |
90
6aa54d3691e5
I needed to understand how OS9 does its memory housekeeping.
roug
parents:
15
diff
changeset
|
200 lbra print |
15 | 201 |
0 | 202 emod |
203 eom equ * | |
15 | 204 end |
205 |