mirror of
https://github.com/a2stuff/prodos-path.git
synced 2025-01-02 22:29:49 +00:00
Add MEM command, inspired by A2osX's BASIC.FX
This commit is contained in:
parent
e3f59575ed
commit
2c8d464108
1
COMMANDS
1
COMMANDS
@ -7,6 +7,7 @@ copy
|
|||||||
date
|
date
|
||||||
echo
|
echo
|
||||||
hello
|
hello
|
||||||
|
mem
|
||||||
online
|
online
|
||||||
type
|
type
|
||||||
touch
|
touch
|
||||||
|
@ -42,6 +42,7 @@ Sample commands included:
|
|||||||
* `ECHO` - echoes back anything following the command
|
* `ECHO` - echoes back anything following the command
|
||||||
* `CD` - like `PREFIX` but accepts `..`, e.g. `cd ../dir`
|
* `CD` - like `PREFIX` but accepts `..`, e.g. `cd ../dir`
|
||||||
* `ONLINE` - lists online volumes (volume name, slot and drive)
|
* `ONLINE` - lists online volumes (volume name, slot and drive)
|
||||||
|
* `MEM` - show memory stats for the BASIC environment
|
||||||
* `COPY` - copy a single file, e.g. `copy /path/to/file,dstfile`
|
* `COPY` - copy a single file, e.g. `copy /path/to/file,dstfile`
|
||||||
* `TYPE` - show file contents (TXT, BAS, or BIN/other), e.g. `type filename`
|
* `TYPE` - show file contents (TXT, BAS, or BIN/other), e.g. `type filename`
|
||||||
* `TOUCH` - apply current ProDOS date/time to a file's modification time, e.g. `touch filename`
|
* `TOUCH` - apply current ProDOS date/time to a file's modification time, e.g. `touch filename`
|
||||||
|
76
mem.cmd.s
Normal file
76
mem.cmd.s
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
;;; ============================================================
|
||||||
|
;;;
|
||||||
|
;;; MEM - Print memory stats
|
||||||
|
;;;
|
||||||
|
;;; Usage: MEM
|
||||||
|
;;;
|
||||||
|
;;; Inspiration from A2osX
|
||||||
|
;;;
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
|
.include "apple2.inc"
|
||||||
|
.include "more_apple2.inc"
|
||||||
|
|
||||||
|
;;; ============================================================
|
||||||
|
|
||||||
|
.org $4000
|
||||||
|
|
||||||
|
jsr CROUT
|
||||||
|
jsr CROUT
|
||||||
|
|
||||||
|
.macro SHOW suffix
|
||||||
|
lda #<.ident(.concat("str_", .string(suffix)))
|
||||||
|
ldx #>.ident(.concat("str_", .string(suffix)))
|
||||||
|
ldy #.ident(.concat("addr_", .string(suffix)))
|
||||||
|
jsr Print
|
||||||
|
.endmacro
|
||||||
|
|
||||||
|
SHOW pgm_start
|
||||||
|
SHOW lomem
|
||||||
|
SHOW array_start
|
||||||
|
SHOW array_end
|
||||||
|
SHOW string_start
|
||||||
|
SHOW himem
|
||||||
|
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
addr_pgm_start := $67
|
||||||
|
str_pgm_start: .byte "Program start: $", 0
|
||||||
|
addr_lomem := $69
|
||||||
|
str_lomem: .byte "LOMEM: $", 0
|
||||||
|
addr_array_start := $6B
|
||||||
|
str_array_start: .byte "Array start: $", 0
|
||||||
|
addr_array_end := $6D
|
||||||
|
str_array_end: .byte "Array end: $", 0
|
||||||
|
addr_string_start := $6F
|
||||||
|
str_string_start: .byte "String start: $", 0
|
||||||
|
addr_himem := $73
|
||||||
|
str_himem: .byte "HIMEM: $", 0
|
||||||
|
|
||||||
|
.proc Print
|
||||||
|
sta msg_addr
|
||||||
|
stx msg_addr+1
|
||||||
|
iny ; MSB first
|
||||||
|
sty zp_addr
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
msg_addr := *+1
|
||||||
|
loop: lda $1234,x ; self-modified
|
||||||
|
beq :+
|
||||||
|
ora #$80
|
||||||
|
jsr COUT
|
||||||
|
inx
|
||||||
|
bne loop ; always
|
||||||
|
:
|
||||||
|
jsr getb
|
||||||
|
jsr PRBYTE
|
||||||
|
jsr getb
|
||||||
|
jsr PRBYTE
|
||||||
|
jmp CROUT
|
||||||
|
|
||||||
|
zp_addr := *+1
|
||||||
|
getb: lda $12 ; self-modified
|
||||||
|
dec zp_addr
|
||||||
|
rts
|
||||||
|
.endproc
|
Loading…
Reference in New Issue
Block a user