mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-27 04:49:20 +00:00
131 lines
3.0 KiB
Plaintext
131 lines
3.0 KiB
Plaintext
PR#3
|
||
PREFIX /A2OSX.SRC
|
||
NEW
|
||
INC 1
|
||
AUTO 6
|
||
.LIST OFF
|
||
.OP 65C02
|
||
.OR $2000
|
||
.TF /A2OSX.BOOT/BIN/MEM
|
||
*--------------------------------------
|
||
.INB /A2OSX.DEV/INC/MACROS.I
|
||
.INB /A2OSX.DEV/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 Code Length To Relocate
|
||
.DA DS.END-DS.START Data Segment to Allocate
|
||
.DA 0
|
||
.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 >LDYA L.MemStat
|
||
>SYSCALL GetMemStatYA
|
||
|
||
>LDYA L.MSG.Main
|
||
>SYSCALL PrintFYA
|
||
|
||
lda MemStat+S.MEMSTAT.MF
|
||
sec
|
||
sbc MemStat+S.MEMSTAT.ML
|
||
tay
|
||
lda MemStat+S.MEMSTAT.MF+1
|
||
sbc MemStat+S.MEMSTAT.ML+1
|
||
>PUSHYA
|
||
|
||
>PUSHW MemStat+S.MEMSTAT.MH
|
||
>PUSHW MemStat+S.MEMSTAT.MF
|
||
>PUSHW MemStat+S.MEMSTAT.ML
|
||
|
||
>LDYA L.MSG.Stat
|
||
>SYSCALL PrintFYA
|
||
*--------------------------------------
|
||
>LDYA L.MSG.Aux
|
||
>SYSCALL PrintFYA
|
||
|
||
lda MemStat+S.MEMSTAT.XF
|
||
sec
|
||
sbc MemStat+S.MEMSTAT.XL
|
||
tay
|
||
lda MemStat+S.MEMSTAT.XF+1
|
||
sbc MemStat+S.MEMSTAT.XL+1
|
||
>PUSHYA
|
||
|
||
>PUSHW MemStat+S.MEMSTAT.XH
|
||
>PUSHW MemStat+S.MEMSTAT.XF
|
||
>PUSHW MemStat+S.MEMSTAT.XL
|
||
|
||
>LDYA L.MSG.Stat
|
||
>SYSCALL PrintFYA
|
||
*--------------------------------------
|
||
>LDYA L.MSG.Kernel
|
||
>SYSCALL PrintFYA
|
||
|
||
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
|
||
|
||
>PUSHW MemStat+S.MEMSTAT.DH
|
||
>PUSHW MemStat+S.MEMSTAT.DF
|
||
>PUSHW MemStat+S.MEMSTAT.DL
|
||
|
||
>LDYA L.MSG.Stat
|
||
>SYSCALL PrintFYA
|
||
|
||
>LDYA L.MSG.End
|
||
>SYSCALL PrintFYA
|
||
lda #0
|
||
sec
|
||
rts
|
||
*--------------------------------------
|
||
CS.RUN
|
||
CS.DOEVENT
|
||
CS.QUIT clc
|
||
rts
|
||
*--------------------------------------
|
||
CS.END
|
||
MSG.Main >CSTR "--- Main Memory ---------------\n"
|
||
MSG.Aux >CSTR "--- Aux Memory ----------------\n"
|
||
MSG.Kernel >CSTR "--- Kernel (Drivers) Memory ---\n"
|
||
MSG.Stat >CSTR " Low : $%H\n Free Ptr : $%H\n High : $%H\n Available Memory : %05D Bytes\n"
|
||
MSG.End >CSTR "-------------------------------\n"
|
||
MemStat .BS S.MEMSTAT
|
||
*--------------------------------------
|
||
.DUMMY
|
||
.OR 0
|
||
DS.START
|
||
DS.END
|
||
.ED
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE BIN/MEM.S
|
||
ASM
|