2015-03-14 21:47:37 +00:00
|
|
|
|
PR#3
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2015-03-14 21:47:37 +00:00
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.TF /A2OSX.BUILD/BIN/MEM
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2017-03-29 15:48:15 +00:00
|
|
|
|
.INB /A2OSX.BUILD/INC/MACROS.I
|
|
|
|
|
.INB /A2OSX.BUILD/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
|
|
|
|
|
.DA CS.END-CS.START Code Length To Relocate
|
|
|
|
|
.DA DS.END-DS.START Data Segment to Allocate
|
|
|
|
|
.DA 0
|
|
|
|
|
.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
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetMemStatYA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>LDYA L.MSG.Main
|
2016-11-03 16:27:43 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2015-09-13 20:35:07 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
lda MemStat+S.MEMSTAT.MF
|
2015-09-13 20:35:07 +00:00
|
|
|
|
sec
|
2016-10-08 20:53:45 +00:00
|
|
|
|
sbc MemStat+S.MEMSTAT.ML
|
2015-09-13 20:35:07 +00:00
|
|
|
|
tay
|
2016-10-08 20:53:45 +00:00
|
|
|
|
lda MemStat+S.MEMSTAT.MF+1
|
|
|
|
|
sbc MemStat+S.MEMSTAT.ML+1
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>PUSHYA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>PUSHW MemStat+S.MEMSTAT.MH
|
|
|
|
|
>PUSHW MemStat+S.MEMSTAT.MF
|
|
|
|
|
>PUSHW MemStat+S.MEMSTAT.ML
|
2015-03-14 21:47:37 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>LDYA L.MSG.Stat
|
2016-11-03 16:27:43 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2016-10-08 20:53:45 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
>LDYA L.MSG.Aux
|
2016-11-03 16:27:43 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2016-10-08 20:53:45 +00:00
|
|
|
|
|
|
|
|
|
lda MemStat+S.MEMSTAT.XF
|
|
|
|
|
sec
|
|
|
|
|
sbc MemStat+S.MEMSTAT.XL
|
|
|
|
|
tay
|
|
|
|
|
lda MemStat+S.MEMSTAT.XF+1
|
|
|
|
|
sbc MemStat+S.MEMSTAT.XL+1
|
2015-03-14 21:47:37 +00:00
|
|
|
|
>PUSHYA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>PUSHW MemStat+S.MEMSTAT.XH
|
|
|
|
|
>PUSHW MemStat+S.MEMSTAT.XF
|
|
|
|
|
>PUSHW MemStat+S.MEMSTAT.XL
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>LDYA L.MSG.Stat
|
2016-11-03 16:27:43 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2015-03-14 21:47:37 +00:00
|
|
|
|
*--------------------------------------
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>LDYA L.MSG.Kernel
|
2016-11-03 16:27:43 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2016-10-08 20:53:45 +00:00
|
|
|
|
|
|
|
|
|
lda MemStat+S.MEMSTAT.DH
|
|
|
|
|
sec
|
|
|
|
|
sbc MemStat+S.MEMSTAT.DF
|
|
|
|
|
tay
|
|
|
|
|
lda MemStat+S.MEMSTAT.DH+1
|
|
|
|
|
sbc MemStat+S.MEMSTAT.DF+1
|
|
|
|
|
>PUSHYA
|
2015-09-13 20:35:07 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>PUSHW MemStat+S.MEMSTAT.DH
|
|
|
|
|
>PUSHW MemStat+S.MEMSTAT.DF
|
|
|
|
|
>PUSHW MemStat+S.MEMSTAT.DL
|
2015-09-13 20:35:07 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>LDYA L.MSG.Stat
|
2016-11-03 16:27:43 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2015-09-13 20:35:07 +00:00
|
|
|
|
|
2016-10-08 20:53:45 +00:00
|
|
|
|
>LDYA L.MSG.End
|
2016-11-03 16:27:43 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
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
|
2017-02-28 16:58:36 +00:00
|
|
|
|
MSG.Main >CSTR "--- Main Memory ---------------\r\n"
|
|
|
|
|
MSG.Aux >CSTR "--- Aux Memory ----------------\r\n"
|
|
|
|
|
MSG.Kernel >CSTR "--- Kernel (Drivers) Memory ---\r\n"
|
|
|
|
|
MSG.Stat >CSTR " Low : $%H\r\n Free Ptr : $%H\r\n High : $%H\r\n Available Memory : %05D Bytes\r\n"
|
|
|
|
|
MSG.End >CSTR "-------------------------------\r\n"
|
2016-10-08 20:53:45 +00:00
|
|
|
|
MemStat .BS S.MEMSTAT
|
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
|