File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77date
88echo
99hello
10+ mem
1011online
1112type
1213touch
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ Sample commands included:
4242* ` ECHO ` - echoes back anything following the command
4343* ` CD ` - like ` PREFIX ` but accepts ` .. ` , e.g. ` cd ../dir `
4444* ` ONLINE ` - lists online volumes (volume name, slot and drive)
45+ * ` MEM ` - show memory stats for the BASIC environment
4546* ` COPY ` - copy a single file, e.g. ` copy /path/to/file,dstfile `
4647* ` TYPE ` - show file contents (TXT, BAS, or BIN/other), e.g. ` type filename `
4748* ` TOUCH ` - apply current ProDOS date/time to a file's modification time, e.g. ` touch filename `
Original file line number Diff line number Diff line change 1+ ;;; ============================================================
2+ ;;;
3+ ;;; MEM - Print memory stats
4+ ;;;
5+ ;;; Usage: MEM
6+ ;;;
7+ ;;; Inspiration from A2osX
8+ ;;;
9+ ;;; ============================================================
10+
11+ .include "apple2.inc"
12+ .include "more_apple2.inc"
13+
14+ ;;; ============================================================
15+
16+ .org $4000
17+
18+ jsr CROUT
19+ jsr CROUT
20+
21+ .macro SHOW suffix
22+ lda #<.ident(.concat("str_" , .string(suffix)))
23+ ldx #>.ident(.concat("str_" , .string(suffix)))
24+ ldy #.ident(.concat("addr_" , .string(suffix)))
25+ jsr Print
26+ .endmacro
27+
28+ SHOW pgm_start
29+ SHOW lomem
30+ SHOW array_start
31+ SHOW array_end
32+ SHOW string_start
33+ SHOW himem
34+
35+ clc
36+ rts
37+
38+ addr_pgm_start := $67
39+ str_pgm_start: .byte "Program start: $" , 0
40+ addr_lomem := $69
41+ str_lomem: .byte "LOMEM: $" , 0
42+ addr_array_start := $6B
43+ str_array_start: .byte "Array start: $" , 0
44+ addr_array_end := $6D
45+ str_array_end: .byte "Array end: $" , 0
46+ addr_string_start := $6F
47+ str_string_start: .byte "String start: $" , 0
48+ addr_himem := $73
49+ str_himem: .byte "HIMEM: $" , 0
50+
51+ .proc Print
52+ sta msg_addr
53+ stx msg_addr+1
54+ iny ; MSB first
55+ sty zp_addr
56+
57+ ldx #0
58+ msg_addr := *+1
59+ loop: lda $1234 ,x ; self-modified
60+ beq :+
61+ ora #$80
62+ jsr COUT
63+ inx
64+ bne loop ; always
65+ :
66+ jsr getb
67+ jsr PRBYTE
68+ jsr getb
69+ jsr PRBYTE
70+ jmp CROUT
71+
72+ zp_addr := *+1
73+ getb: lda $12 ; self-modified
74+ dec zp_addr
75+ rts
76+ .endproc
You can’t perform that action at this time.
0 commit comments