annotate level2/cmds/smap.asm @ 3278:ea1afb494127

defs: Add Bt.Sec for atari and corsham
author Tormod Volden <debian.tormod@gmail.com>
date Sat, 07 Mar 2020 23:52:40 +0100
parents 147d2267d9b8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
1 *******************************************************************
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
2 * SMap - Show System Memory Map
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
3 *
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
4 * $Id$
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
5 *
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
6 * From "Inside OS9 Level II", by Kevin Darling
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
7 *
1255
bf6f854a4299 Changed revisions to 0
boisy
parents: 965
diff changeset
8 * Edt/Rev YYYY/MM/DD Modified by
bf6f854a4299 Changed revisions to 0
boisy
parents: 965
diff changeset
9 * Comment
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
10 * ------------------------------------------------------------------
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
11 * 1 ????/??/??
1255
bf6f854a4299 Changed revisions to 0
boisy
parents: 965
diff changeset
12 * Original version.
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
13
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
14 nam SMap
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
15 ttl Show System Memory Map
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
16
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
17 * Disassembled 02/05/12 22:05:11 by Disasm v1.6 (C) 1988 by RML
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
18
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
19 ifp1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
20 use defsfile
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
21 endc
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
22
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
23 tylg set Prgrm+Objct
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
24 atrv set ReEnt+rev
1255
bf6f854a4299 Changed revisions to 0
boisy
parents: 965
diff changeset
25 rev set $00
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
26 edition set 1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
27
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
28 mod eom,name,tylg,atrv,start,msize
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
29
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
30 leadflag rmb 1
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
31 decbuff rmb 3 decimal buffer (100, 10, 1s place)
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
32 free rmb 1 number of free 256 byte pages in system memory
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
33 row rmb 1
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
34 spc rmb 1
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
35 out rmb 3 ONLY 2 BYTES USED
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
36 mapsiz rmb 2 NEVER USED
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
37 blksiz rmb 2 NEVER USED
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
38 blknum rmb 1
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
39 buffer rmb 256
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
40 stack rmb 200
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
41 msize equ .
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
42
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
43 name fcs /SMap/
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
44 fcb edition
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
45
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
46 H1 fcc " 0 1 2 3 4 5 6 7 8 9 A B C D E F"
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
47 CrRt fcb C$CR
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
48 H1L equ *-H1
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
49 H2 fcc " # = = = = = = = = = = = = = = = ="
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
50 * fcb C$CR
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
51 H2L equ *-H2
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
52 SysDat fcb $00,$00,$00,$00
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
53
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
54 start lbsr WriteCR Write a carriage return to standard out
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
55 leax <H1,pcr point to header 1
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
56 lda #$01
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
57 ldy #H1L
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
58 os9 I$WritLn and write it to standard out
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
59 leax <H2,pcr same with header 2
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
60 ldy #H2L
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
61 os9 I$Write
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
62
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
63 * Get SysMap pointer
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
64 leax <SysDat,pcr
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
65 tfr x,d
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
66 ldx #D.SysMem point to System Memory global
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
67 ldy #$0002 get 2 byte pointer into system RAM
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
68 pshs u save statics
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
69 leau buffer,u point to destination
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
70 os9 F$CpyMem get it
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
71 puls u restore statics
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
72 lbcs error branch if error
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
73
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
74 * Get SysMap
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
75 ldx buffer,u get pointer into system memory table in system space
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
76 ldy #256 all 256 bytes
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
77 pshs u save statics
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
78 leau buffer,u point to destination
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
79 os9 F$CpyMem copy memory
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
80 puls u restore statics
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
81 lbcs error branch if error
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
82
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
83 clr <blknum
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
84 clr <free clear free counter
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
85 leax buffer,u
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
86 lda #$30
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
87 sta <row
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
88 clr ,-s save count
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
89 loop lda ,s
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
90 bita #$0F
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
91 bne loop2
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
92 pshs x
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
93 lbsr WriteCR
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
94 leax spc,u
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
95 ldy #$0004
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
96 lda <row
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
97 cmpa #':
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
98 bne oknum
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
99 lda #'A
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
100 sta <row
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
101 oknum sta <out
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
102 inc <row
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
103 ldd #C$SPAC*256+C$SPAC
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
104 sta <spc
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
105 std <out+1
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
106 lda #$01
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
107 os9 I$Write
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
108 puls x
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
109
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
110 loop2 ldb ,x+ get next block
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
111 beq unused
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
112 bmi noram
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
113 ldb #'U RAM-in-use
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
114 bra put
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
115 noram ldb #'. not RAM
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
116 bra put
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
117 unused ldb #'_ not used
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
118 inc <free increment free page counter
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
119
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
120 put stb <out
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
121 ldb #C$SPAC
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
122 stb <out+1
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
123 pshs x
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
124 leax out,u
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
125 ldy #$0002
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
126 lda #$01
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
127 os9 I$Write
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
128 puls x
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
129 dec ,s
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
130 lbhi loop
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
131 puls a
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
132
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
133 bsr WriteCR
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
134 bsr WriteCR
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
135 leax >FreePgs,pcr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
136 ldy #FreePgsL
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
137 lda #$01
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
138 os9 I$Write
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
139 ldb <free
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
140 clra
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
141 lbsr outdec
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
142 bsr WriteCR
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
143
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
144 leax >FreeRAM,pcr
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
145 ldy #FreeRAML
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
146 lda #$01
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
147 os9 I$Write
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
148 ldb <free
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
149 clra
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
150 lsrb
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
151 lsrb
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
152 lbsr outdec
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
153 bsr WriteCR
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
154 clrb
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
155 error os9 F$Exit
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
156
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
157 FreePgs fcc " Number of Free Pages: "
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
158 FreePgsL equ *-FreePgs
1385
2bd57e595948 Ram changed to RAM
boisy
parents: 1255
diff changeset
159 FreeRAM fcc " RAM Free in KBytes: "
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
160 FreeRAML equ *-FreeRAM
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
161
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
162 WriteCR pshs x,a
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
163 leax CrRt,pcr
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
164 ldy #$0001
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
165 lda #$01
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
166 os9 I$WritLn
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
167 puls pc,x,a
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
168
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
169 print sta <out
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
170 pshs x
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
171 leax out,u
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
172 ldy #$0001
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
173 lda #$01
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
174 os9 I$Write
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
175 puls pc,x
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
176
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
177 outdec leax decbuff,u D=number
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
178 clr <leadflag
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
179 clr ,x
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
180 clr $01,x
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
181 clr $02,x
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
182 hundred inc ,x
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
183 subd #100
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
184 bcc hundred
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
185 addd #100
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
186 ten inc $01,x
1633
457765ff46f9 minor optimizations
boisy
parents: 1385
diff changeset
187 subd #10
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
188 bcc ten
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
189 addd #10
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
190 incb
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
191 stb $02,x
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
192 bsr printled
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
193 bsr printled
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
194
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
195 printnum lda ,x+
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
196 adda #$2F make ASCII
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
197 bra print
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
198
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
199 printled tst <leadflag print leading zero?
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
200 bne printnum ..yes
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
201 ldb ,x is it zero?
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
202 inc <leadflag
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
203 decb
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
204 bne printnum ..no, print zeroes
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
205 clr <leadflag else supress
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
206 lda #C$SPAC
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
207 leax 1,x
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
208 bra print
965
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
209
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
210 emod
53553cdc265c New commands added to standard CMDS
boisy
parents:
diff changeset
211 eom equ *
3191
147d2267d9b8 smap.asm: Annotate comments, remove trailing whitespace
Neal Crook <foofoobedoo@gmail.com>
parents: 1633
diff changeset
212 end