2015-03-14 21:47:37 +00:00
|
|
|
|
NEW
|
2019-07-24 05:53:09 +00:00
|
|
|
|
AUTO 3,1
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2020-02-16 20:45:16 +00:00
|
|
|
|
.TF bin/mem
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2020-08-12 19:31:36 +00:00
|
|
|
|
.INB inc/macros.i
|
|
|
|
|
.INB inc/a2osx.i
|
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-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
* File Header (16 Bytes)
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
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
|
2017-09-22 06:38:22 +00:00
|
|
|
|
.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
|
|
|
|
*--------------------------------------
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
2022-11-02 06:54:30 +00:00
|
|
|
|
.DA CS.DOEVENT
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.DA CS.QUIT
|
2016-10-08 20:53:45 +00:00
|
|
|
|
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
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2017-01-15 20:51:20 +00:00
|
|
|
|
CS.INIT clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN >LDYA L.MemStat
|
2018-07-18 15:30:42 +00:00
|
|
|
|
>SYSCALL GetMemStat
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>LDYA L.MSG.Main
|
2020-02-27 16:46:40 +00:00
|
|
|
|
>SYSCALL PutS
|
2015-09-13 20:35:07 +00:00
|
|
|
|
|
2017-10-27 06:36:46 +00:00
|
|
|
|
lda MemStat+S.MSTAT.MF
|
2015-09-13 20:35:07 +00:00
|
|
|
|
sec
|
2017-10-27 06:36:46 +00:00
|
|
|
|
sbc MemStat+S.MSTAT.ML
|
2015-09-13 20:35:07 +00:00
|
|
|
|
tay
|
2017-10-27 06:36:46 +00:00
|
|
|
|
lda MemStat+S.MSTAT.MF+1
|
|
|
|
|
sbc MemStat+S.MSTAT.ML+1
|
2020-02-14 16:32:52 +00:00
|
|
|
|
ldx #S.MSTAT.ML
|
2019-03-07 16:48:30 +00:00
|
|
|
|
jsr CS.RUN.PRINT
|
2019-02-18 12:52:10 +00:00
|
|
|
|
>SLEEP
|
2019-03-07 16:48:30 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>LDYA L.MSG.Aux
|
2020-02-27 16:46:40 +00:00
|
|
|
|
>SYSCALL PutS
|
2016-10-08 20:53:45 +00:00
|
|
|
|
|
2017-10-27 06:36:46 +00:00
|
|
|
|
lda MemStat+S.MSTAT.XF
|
2016-10-08 20:53:45 +00:00
|
|
|
|
sec
|
2017-10-27 06:36:46 +00:00
|
|
|
|
sbc MemStat+S.MSTAT.XL
|
2016-10-08 20:53:45 +00:00
|
|
|
|
tay
|
2017-10-27 06:36:46 +00:00
|
|
|
|
lda MemStat+S.MSTAT.XF+1
|
|
|
|
|
sbc MemStat+S.MSTAT.XL+1
|
2020-02-14 16:32:52 +00:00
|
|
|
|
ldx #S.MSTAT.XL
|
2019-03-07 16:48:30 +00:00
|
|
|
|
jsr CS.RUN.PRINT
|
2019-02-18 12:52:10 +00:00
|
|
|
|
>SLEEP
|
2019-03-07 16:48:30 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>LDYA L.MSG.Kernel
|
2020-02-27 16:46:40 +00:00
|
|
|
|
>SYSCALL PutS
|
2016-10-08 20:53:45 +00:00
|
|
|
|
|
2017-10-27 06:36:46 +00:00
|
|
|
|
lda MemStat+S.MSTAT.DH
|
2016-10-08 20:53:45 +00:00
|
|
|
|
sec
|
2017-10-27 06:36:46 +00:00
|
|
|
|
sbc MemStat+S.MSTAT.DF
|
2016-10-08 20:53:45 +00:00
|
|
|
|
tay
|
2017-10-27 06:36:46 +00:00
|
|
|
|
lda MemStat+S.MSTAT.DH+1
|
|
|
|
|
sbc MemStat+S.MSTAT.DF+1
|
2020-02-14 16:32:52 +00:00
|
|
|
|
ldx #S.MSTAT.DL
|
2019-03-07 16:48:30 +00:00
|
|
|
|
jsr CS.RUN.PRINT
|
2020-02-27 16:46:40 +00:00
|
|
|
|
>LDYA L.MSG.End
|
|
|
|
|
>SYSCALL PutS
|
2015-09-13 20:35:07 +00:00
|
|
|
|
lda #0
|
2016-10-08 20:53:45 +00:00
|
|
|
|
sec
|
2015-09-13 20:35:07 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-02-14 16:32:52 +00:00
|
|
|
|
CS.RUN.PRINT pha
|
|
|
|
|
phy
|
|
|
|
|
>PUSHW L.MSG.Stat
|
2022-11-02 06:54:30 +00:00
|
|
|
|
|
2020-02-14 16:32:52 +00:00
|
|
|
|
ldy #3
|
2022-11-02 06:54:30 +00:00
|
|
|
|
|
2020-02-14 16:32:52 +00:00
|
|
|
|
.1 >PUSHW MemStat,x
|
|
|
|
|
>PUSHW MemStat,x
|
|
|
|
|
inx
|
|
|
|
|
inx
|
2019-03-07 16:48:30 +00:00
|
|
|
|
dey
|
|
|
|
|
bne .1
|
2022-11-02 06:54:30 +00:00
|
|
|
|
|
2020-02-14 16:32:52 +00:00
|
|
|
|
ply
|
|
|
|
|
pla
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>PUSHBI 14
|
2020-02-27 16:46:40 +00:00
|
|
|
|
>SYSCALL PrintF
|
2019-03-07 16:48:30 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-01-15 20:51:20 +00:00
|
|
|
|
CS.DOEVENT sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-10-08 20:53:45 +00:00
|
|
|
|
CS.QUIT clc
|
2015-03-14 21:47:37 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
2022-11-02 06:54:30 +00:00
|
|
|
|
MSG.Main .CZ "--- Main Memory ----------------"
|
|
|
|
|
MSG.Aux .CZ "--- Aux Memory -----------------"
|
|
|
|
|
MSG.Kernel .CZ "--- Kernel (Drivers) Memory ----"
|
|
|
|
|
MSG.Stat .CS " Low : %5D (%H)\r\n"
|
|
|
|
|
.CS " Free Ptr : %5D (%H)\r\n"
|
|
|
|
|
.CS " High : %5D (%H)\r\n"
|
|
|
|
|
.CZ " Available Memory : %5D Bytes\r\n"
|
|
|
|
|
MSG.End .CZ "--------------------------------"
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DUMMY
|
|
|
|
|
.OR 0
|
|
|
|
|
DS.START
|
2020-08-12 19:31:36 +00:00
|
|
|
|
DS.END .ED
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2020-08-12 19:31:36 +00:00
|
|
|
|
SAVE usr/src/bin/mem.s
|
2015-03-14 21:47:37 +00:00
|
|
|
|
ASM
|