2015-03-14 21:47:37 +00:00
|
|
|
|
NEW
|
2017-12-22 21:24:30 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
|
|
|
|
AUTO 4,1
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.TF BIN/MEM
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-23 15:28:42 +00:00
|
|
|
|
.INB INC/MACROS.I
|
|
|
|
|
.INB INC/A2OSX.I
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
PAGELEN .EQ 22
|
2015-09-13 20:35:07 +00:00
|
|
|
|
FOOTERLEN .EQ 8
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
2015-03-14 21:47:37 +00:00
|
|
|
|
ZPPTR1 .EQ ZPBIN
|
|
|
|
|
ZPPTR2 .EQ ZPBIN+2
|
|
|
|
|
*--------------------------------------
|
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
|
|
|
|
|
.DA #16 SS
|
|
|
|
|
.DA #4 ZP
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
2015-03-14 21:47:37 +00:00
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
|
|
|
|
.DA CS.DOEVENT
|
|
|
|
|
.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
|
2018-07-24 16:00:24 +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
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>PUSHYA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2017-10-27 06:36:46 +00:00
|
|
|
|
>PUSHW MemStat+S.MSTAT.MH
|
|
|
|
|
>PUSHW MemStat+S.MSTAT.MF
|
|
|
|
|
>PUSHW MemStat+S.MSTAT.ML
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>LDYA L.MSG.Stat
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2016-10-08 20:53:45 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
>LDYA L.MSG.Aux
|
2018-07-24 16:00:24 +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
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>PUSHYA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2017-10-27 06:36:46 +00:00
|
|
|
|
>PUSHW MemStat+S.MSTAT.XH
|
|
|
|
|
>PUSHW MemStat+S.MSTAT.XF
|
|
|
|
|
>PUSHW MemStat+S.MSTAT.XL
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>LDYA L.MSG.Stat
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>LDYA L.MSG.Kernel
|
2018-07-24 16:00:24 +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
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>PUSHYA
|
2015-09-13 20:35:07 +00:00
|
|
|
|
|
2017-10-27 06:36:46 +00:00
|
|
|
|
>PUSHW MemStat+S.MSTAT.DH
|
|
|
|
|
>PUSHW MemStat+S.MSTAT.DF
|
|
|
|
|
>PUSHW MemStat+S.MSTAT.DL
|
2015-09-13 20:35:07 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>LDYA L.MSG.Stat
|
2018-06-21 15:12:10 +00:00
|
|
|
|
>SYSCALL printf
|
2015-09-13 20:35:07 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>LDYA L.MSG.End
|
2018-07-24 16:00:24 +00:00
|
|
|
|
>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
|
|
|
|
|
*--------------------------------------
|
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
|
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 "-------------------------------"
|
2017-10-27 06:36:46 +00:00
|
|
|
|
MemStat .BS S.MSTAT
|
2015-06-03 18:30:57 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DUMMY
|
|
|
|
|
.OR 0
|
|
|
|
|
DS.START
|
2015-03-14 21:47:37 +00:00
|
|
|
|
DS.END
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.ED
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2017-03-29 15:48:15 +00:00
|
|
|
|
SAVE /A2OSX.SRC/BIN/MEM.S
|
2015-03-14 21:47:37 +00:00
|
|
|
|
ASM
|