mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-29 17:50:18 +00:00
136 lines
3.1 KiB
Plaintext
136 lines
3.1 KiB
Plaintext
PR#3
|
||
PREFIX /A2OSX.BUILD
|
||
NEW
|
||
INC 1
|
||
AUTO 6
|
||
.LIST OFF
|
||
.OP 65C02
|
||
.OR $2000
|
||
.TF /A2OSX.BUILD/BIN/MEM
|
||
*--------------------------------------
|
||
.INB /A2OSX.BUILD/INC/MACROS.I
|
||
.INB /A2OSX.BUILD/INC/A2OSX.I
|
||
*--------------------------------------
|
||
PAGELEN .EQ 22
|
||
FOOTERLEN .EQ 8
|
||
*--------------------------------------
|
||
ZPPTR1 .EQ ZPBIN
|
||
ZPPTR2 .EQ ZPBIN+2
|
||
*--------------------------------------
|
||
* File Header (16 Bytes)
|
||
*--------------------------------------
|
||
CS.START cld
|
||
jmp (.1,x)
|
||
.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
|
||
.DA #16 SS
|
||
.DA #4 ZP
|
||
.DA 0
|
||
*--------------------------------------
|
||
* Relocation Table
|
||
*--------------------------------------
|
||
.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
|
||
>SYSCALL GetMemStat.YA
|
||
|
||
>LDYA L.MSG.Main
|
||
>SYSCALL PrintF.YA
|
||
|
||
lda MemStat+S.MSTAT.MF
|
||
sec
|
||
sbc MemStat+S.MSTAT.ML
|
||
tay
|
||
lda MemStat+S.MSTAT.MF+1
|
||
sbc MemStat+S.MSTAT.ML+1
|
||
>PUSHYA
|
||
|
||
>PUSHW MemStat+S.MSTAT.MH
|
||
>PUSHW MemStat+S.MSTAT.MF
|
||
>PUSHW MemStat+S.MSTAT.ML
|
||
|
||
>LDYA L.MSG.Stat
|
||
>SYSCALL PrintF.YA
|
||
*--------------------------------------
|
||
>LDYA L.MSG.Aux
|
||
>SYSCALL PrintF.YA
|
||
|
||
lda MemStat+S.MSTAT.XF
|
||
sec
|
||
sbc MemStat+S.MSTAT.XL
|
||
tay
|
||
lda MemStat+S.MSTAT.XF+1
|
||
sbc MemStat+S.MSTAT.XL+1
|
||
>PUSHYA
|
||
|
||
>PUSHW MemStat+S.MSTAT.XH
|
||
>PUSHW MemStat+S.MSTAT.XF
|
||
>PUSHW MemStat+S.MSTAT.XL
|
||
|
||
>LDYA L.MSG.Stat
|
||
>SYSCALL PrintF.YA
|
||
*--------------------------------------
|
||
>LDYA L.MSG.Kernel
|
||
>SYSCALL PrintF.YA
|
||
|
||
lda MemStat+S.MSTAT.DH
|
||
sec
|
||
sbc MemStat+S.MSTAT.DF
|
||
tay
|
||
lda MemStat+S.MSTAT.DH+1
|
||
sbc MemStat+S.MSTAT.DF+1
|
||
>PUSHYA
|
||
|
||
>PUSHW MemStat+S.MSTAT.DH
|
||
>PUSHW MemStat+S.MSTAT.DF
|
||
>PUSHW MemStat+S.MSTAT.DL
|
||
|
||
>LDYA L.MSG.Stat
|
||
>SYSCALL PrintF.YA
|
||
|
||
>LDYA L.MSG.End
|
||
>SYSCALL PrintF.YA
|
||
lda #0
|
||
sec
|
||
rts
|
||
*--------------------------------------
|
||
CS.DOEVENT sec
|
||
rts
|
||
*--------------------------------------
|
||
CS.QUIT clc
|
||
rts
|
||
*--------------------------------------
|
||
CS.END
|
||
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"
|
||
MemStat .BS S.MSTAT
|
||
*--------------------------------------
|
||
.DUMMY
|
||
.OR 0
|
||
DS.START
|
||
DS.END
|
||
.ED
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE /A2OSX.SRC/BIN/MEM.S
|
||
ASM
|