A2osX/BIN/MEM.S.txt

133 lines
2.8 KiB
Plaintext
Raw Normal View History

NEW
2019-07-24 05:53:09 +00:00
AUTO 3,1
.LIST OFF
.OP 65C02
.OR $2000
2018-07-23 15:28:42 +00:00
.TF BIN/MEM
*--------------------------------------
2018-07-23 15:28:42 +00:00
.INB INC/MACROS.I
.INB INC/A2OSX.I
*--------------------------------------
2015-06-03 18:30:57 +00:00
PAGELEN .EQ 22
FOOTERLEN .EQ 8
2015-06-03 18:30:57 +00:00
*--------------------------------------
2019-03-07 16:48:30 +00:00
.DUMMY
.OR ZPBIN
ZS.START
MemStat .BS S.MSTAT
ZS.END .ED
*--------------------------------------
2015-06-03 18:30:57 +00:00
* File Header (16 Bytes)
*--------------------------------------
CS.START cld
jmp (.1,x)
2015-06-03 18:30:57 +00:00
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA 0
.DA CS.END-CS.START CS
.DA DS.END-DS.START DS
2019-06-02 08:58:46 +00:00
.DA #64 SS
2019-03-07 16:48:30 +00:00
.DA #ZS.END-ZS.START Zero Page Size
2015-06-03 18:30:57 +00:00
.DA 0
*--------------------------------------
* Relocation Table
2019-10-03 06:25:27 +00:00
*--------------------------------------
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.MSG.Main .DA MSG.Main
L.MSG.Aux .DA MSG.Aux
L.MSG.Kernel .DA MSG.Kernel
L.MSG.Stat .DA MSG.Stat
L.MSG.End .DA MSG.End
L.MemStat .DA MemStat
.DA 0
*--------------------------------------
CS.INIT clc
rts
*--------------------------------------
CS.RUN >LDYA L.MemStat
2018-07-18 15:30:42 +00:00
>SYSCALL GetMemStat
>LDYA L.MSG.Main
2018-07-24 16:00:24 +00:00
>SYSCALL puts
lda MemStat+S.MSTAT.MF
sec
sbc MemStat+S.MSTAT.ML
tay
lda MemStat+S.MSTAT.MF+1
sbc MemStat+S.MSTAT.ML+1
2019-03-07 16:48:30 +00:00
ldx #S.MSTAT.MH+1
jsr CS.RUN.PRINT
2019-02-18 12:52:10 +00:00
>SLEEP
2019-03-07 16:48:30 +00:00
>LDYA L.MSG.Aux
2018-07-24 16:00:24 +00:00
>SYSCALL puts
lda MemStat+S.MSTAT.XF
sec
sbc MemStat+S.MSTAT.XL
tay
lda MemStat+S.MSTAT.XF+1
sbc MemStat+S.MSTAT.XL+1
2019-03-07 16:48:30 +00:00
ldx #S.MSTAT.XH+1
jsr CS.RUN.PRINT
2019-02-18 12:52:10 +00:00
>SLEEP
2019-03-07 16:48:30 +00:00
>LDYA L.MSG.Kernel
2018-07-24 16:00:24 +00:00
>SYSCALL puts
lda MemStat+S.MSTAT.DH
sec
sbc MemStat+S.MSTAT.DF
tay
lda MemStat+S.MSTAT.DH+1
sbc MemStat+S.MSTAT.DF+1
2019-03-07 16:48:30 +00:00
ldx #S.MSTAT.DH+1
jsr CS.RUN.PRINT
>LDYA L.MSG.END
2018-07-24 16:00:24 +00:00
>SYSCALL puts
lda #0
sec
rts
*--------------------------------------
2019-03-07 16:48:30 +00:00
CS.RUN.PRINT >PUSHYA
ldy #6
.1 >PUSHB MemStat,x
dex
dey
bne .1
>PUSHBI 8
>LDYA L.MSG.Stat
>SYSCALL printf
rts
*--------------------------------------
CS.DOEVENT sec
rts
*--------------------------------------
CS.QUIT clc
rts
*--------------------------------------
CS.END
2018-07-24 16:00:24 +00:00
MSG.Main .AZ "--- Main Memory ---------------"
MSG.Aux .AZ "--- Aux Memory ----------------"
MSG.Kernel .AZ "--- Kernel (Drivers) Memory ---"
MSG.Stat .AS " Low : $%H\r\n"
.AS " Free Ptr : $%H\r\n"
.AS " High : $%H\r\n"
.AZ " Available Memory : %05D Bytes\r\n"
MSG.End .AZ "-------------------------------"
2015-06-03 18:30:57 +00:00
*--------------------------------------
.DUMMY
.OR 0
DS.START
DS.END
2015-06-03 18:30:57 +00:00
.ED
*--------------------------------------
MAN
2018-12-21 14:32:45 +00:00
SAVE USR/SRC/BIN/MEM.S
ASM