A2osX/INC/KERNEL.I.txt
2018-01-15 06:50:44 +00:00

149 lines
4.5 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
PREFIX /A2OSX.BUILD
AUTO 4,1
.LIST OFF
*--------------------------------------
* KERNEL CONSTANTS DEFINITON
*--------------------------------------
K.ENV.SIZE .EQ 256
K.FLT.MAX .EQ 4
K.EVT.MAX .EQ 8
K.DEV.MAX .EQ 32
K.PS.MAX .EQ 32
*--------------------------------------
H.BIN.T .EQ 0
H.BIN.T.DRV65 .EQ $4CD8 6502:cld,jmp abs
H.BIN.T.LIB65 .EQ $7CD8 6502:cld,jmp (abs,x)
H.BIN.T.BIN65 .EQ $7CD8 6502:cld,jmp (abs,x)
*H.BIN.T.LIB80 .EQ $A28D Z80:
*H.BIN.T.BIN80 .EQ $A28D Z80:
H.BIN.JMP .EQ 2
*H.BIN.CODE.TYPE .EQ 4
*H.BIN.VERSION .EQ 5
H.BIN.CODE.LEN .EQ 8
*
H.BIN.EXE.DS.SIZE .EQ 10
H.BIN.EXE.SS.SIZE .EQ 12
H.BIN.EXE.ZP.SIZE .EQ 13
H.BIN.EXE.REL.TABLE .EQ 16
*
H.BIN.DRV.HEADER.O .EQ 10
H.BIN.DRV.CODE.O .EQ 12
H.BIN.DRV.CODE.LEN .EQ 14
H.BIN.DRV.REL.TABLE .EQ 0
*--------------------------------------
ZPKERNEL .EQ $0
ZPMEMMGR .EQ $10
*--------------------------------------
* MoveAux / XFer
*--------------------------------------
A1L .EQ $3C
A2L .EQ $3E
A4L .EQ $42
XFer.JMP .EQ $3ED
AuxMove .EQ $C311
XFer .EQ $C314 CS:M->X, VS:Use Aux ZP
*--------------------------------------
* $42-$47 ProDOS Block Device Drivers Main
*--------------------------------------
* $5E-$C8 RESERVED APPLESOFT Main/Aux (ROM Call, no need to switch back MainZP)
*--------------------------------------
SIGNFLG .EQ $16 COS,SIN,TAN
INDEX .EQ $5E ->$5F
FORPNT .EQ $85 ->$86
FAC .EQ $9D ->$A1
FAC.SIGN .EQ $A2
*FAC.EXTENSION .EQ $AC
TXTPTR .EQ $B8
*--------------------------------------
* ROM Entry Point
*--------------------------------------
ROM.FSUB .EQ 0
ROM.FADD .EQ 2
ROM.LTOF .EQ 4
ROM.LOG .EQ 6
ROM.FMULT .EQ 8
ROM.SETARG .EQ 10
ROM.FDIV .EQ 12
ROM.SETFAC .EQ 14
ROM.GETFAC .EQ 16 Copy FAC to (FORPNT)
ROM.FCOMP .EQ 18
ROM.QINT .EQ 20
ROM.FIN .EQ 22
ROM.FOUT .EQ 24
ROM.SQR .EQ 26
ROM.PWR .EQ 28
ROM.EXP .EQ 30
ROM.COS .EQ 32
ROM.SIN .EQ 34
ROM.TAN .EQ 36
ROM.ATAN .EQ 38
*--------------------------------------
* Memory Map
*--------------------------------------
A2osX.SaveSM .EQ $100 Aux
A2osX.SaveSX .EQ $101 Aux
*--------------------------------------
* Main $200 -> 2FF : (Used By ProDOS,Clock DRV....)
* Main $300 -> 3EF : <free>
* Main $3F0 -> 3FF : SYS Vectors (reset,IRQ...)
* Aux $200 -> 3FD : /RAM Driver
* Aux $3FE -> 3FF : IRQ Vector
*--------------------------------------
K.S.STAT .EQ $0300 S.STAT for internal kernel operations
K.S.DSTAT .EQ $0340 S.DSTAT=25 or higher depends on dev type
K.SP.PARAMS .EQ $0360 Max 9 bytes
K.MLI.PATH .EQ $0369 64+1
K.MLI.PARAMS .EQ $03AA Main, 18 bytes min for GetFileInfo (ATLK needs MORE!!!...32 max for now)
*--------------------------------------
K.STACKTOP .EQ $03ED XFer !!! down to $3E0
*--------------------------------------
*** $3F0-$3FF IRQ Handler.... ***
*--------------------------------------
* Main/Aux $400 -> $7FF : TXT PAGE1 System Screen
* Main/Aux $800 -> $BFF : TXT PAGE2 Console Screen
*--------------------------------------
* free $0C00->$17FF = $C00 (3072) Aux
*--------------------------------------
K.Buf256 .EQ $0C00 Main
*--------------------------------------
PS.Table.PID .EQ $0D00 K.PS.MAX
PS.Table.hMem .EQ $0D20 K.PS.MAX
*--------------------------------------
Evt.Table .EQ $0D40 K.EVT.MAX*S.EVT.SIZE=8*8=64b
*--------------------------------------
Flt.Table .EQ $0D80 K.FLT.MAX*S.FLT.SIZE=4*32=128b
*--------------------------------------
Dev.Table .EQ $0E00 K.DEV.MAX*S.DEV=32*16=512b
*--------------------------------------
*** Z80 Reserved $1000-10FF***
*--------------------------------------
Z80JMP .EQ $1000 (00000h) Up To $10FF
Z80STACK .EQ $10FF (000FFh) Down to $1000
*--------------------------------------
* CORE $1100->$17FF = $700 Main
*--------------------------------------
* MemMgr : $1800->$1FFF MAIN/AUX (2 kBytes)
*--------------------------------------
Mem.Table .EQ $1800 Slot 0 is Reserved
Mem.LoMem .EQ $1800
Mem.Free .EQ $1802
Mem.HiMem .EQ $1804
Mem.LastSlot .EQ $1806
*--------------------------------------
Mem.MLoMem .EQ $2000
Mem.MHiMem .EQ $BD00
Mem.XLoMem .EQ $2000
Mem.XHiMem .EQ $C000
*--------------------------------------
DevMgr.HiMem .EQ $FFFA Protect IRQ vectors in Aux LC
*--------------------------------------
MAN
SAVE /A2OSX.BUILD/INC/KERNEL.I
LOAD /A2OSX.SRC/SYS/KERNEL.S
ASM