mirror of
https://github.com/A2osX/A2osX.git
synced 2025-02-08 11:30:41 +00:00
Kernel 0.9.1 : Code reorganization & move to CSTR (PS & Stacks)
This commit is contained in:
parent
a4cf170ce6
commit
d4db5090af
Binary file not shown.
Binary file not shown.
@ -17,27 +17,24 @@ K.PS.MAX .EQ 32
|
||||
*--------------------------------------
|
||||
ZPKERNEL .EQ $0
|
||||
*--------------------------------------
|
||||
ZPMEMMGR .EQ $10
|
||||
ZPMEMMGR .EQ $8
|
||||
*--------------------------------------
|
||||
pCode .EQ $20
|
||||
pData .EQ $22
|
||||
pStack .EQ $24
|
||||
pCode .EQ $10
|
||||
pData .EQ $12
|
||||
pLocal .EQ $14
|
||||
pStack .EQ $16
|
||||
|
||||
*pLib .EQ $26
|
||||
pDrv .EQ $28
|
||||
|
||||
pPs .EQ $2A
|
||||
pDev .EQ $2C
|
||||
pEvent .EQ $2E
|
||||
pDrv .EQ $18
|
||||
pPs .EQ $1A
|
||||
pDev .EQ $1C
|
||||
pEvent .EQ $1E
|
||||
*--------------------------------------
|
||||
ZPBIN .EQ $30
|
||||
ZPBIN .EQ $20
|
||||
ZPDRV .EQ $30
|
||||
ZPLIB .EQ $40 32 bytes for TCPIP
|
||||
*--------------------------------------
|
||||
* $42-$47 ProDOS Block Device Drivers Main
|
||||
*--------------------------------------
|
||||
* $5E-$C8 RESERVED APPLESOFT Main/Aux (ROM Call, no need to switch back MainZP)
|
||||
*--------------------------------------
|
||||
ZPDRV .EQ $D0
|
||||
ZPLIB .EQ $E0 32 bytes for TCPIP
|
||||
* $5E-$C8 RESERVED APPLESOFT Main/Aux (ROM Call, no need to switch back MainZP)
|
||||
*--------------------------------------
|
||||
* Memory Map
|
||||
*--------------------------------------
|
||||
@ -65,7 +62,7 @@ K.MLI.PATH .EQ $03B0 64+1 -> $03D0
|
||||
*--------------------------------------
|
||||
K.Buf256 .EQ $0D00 Main
|
||||
*--------------------------------------
|
||||
K.STACK .EQ $0F00 Up to $0FFF
|
||||
K.STACK .EQ $0F00 from $0fff down to $f00
|
||||
*--------------------------------------
|
||||
*** Z80 Reserved $0F00-10FF***
|
||||
*--------------------------------------
|
||||
@ -101,7 +98,7 @@ DevMgr.HiMem .EQ $FFFA Protect IRQ vectors in Aux LC
|
||||
A2osX.SYSCALL .EQ $BD00
|
||||
A2osX.LIBCALL .EQ $BD03
|
||||
A2osX.MLICALL .EQ $BD06
|
||||
*
|
||||
A2osX.ROMCALL .EQ $BD09
|
||||
A2osX.BADCALL .EQ $BD0C
|
||||
*--------------------------------------
|
||||
pCodeJmp .EQ $BD10
|
||||
@ -452,8 +449,8 @@ S.PS.CPID .EQ 3
|
||||
S.PS.hCS .EQ 4
|
||||
S.PS.hDS .EQ 5
|
||||
S.PS.hSS .EQ 6
|
||||
S.PS.hENV .EQ 7
|
||||
*
|
||||
S.PS.SP .EQ 7
|
||||
S.PS.hENV .EQ 8
|
||||
S.PS.hPREFIX .EQ 9
|
||||
S.PS.hStdIn .EQ 10
|
||||
S.PS.hStdOut .EQ 11
|
||||
|
@ -26,6 +26,12 @@ AUTO 6
|
||||
ldx #SYS.]1
|
||||
jsr A2osX.SYSCALL
|
||||
.EM
|
||||
*--------------------------------------
|
||||
.MA LIBCALL
|
||||
ldy ]1
|
||||
ldx #]2
|
||||
jsr A2osX.LIBCALL
|
||||
.EM
|
||||
*--------------------------------------
|
||||
.MA MLICALL
|
||||
ldx #]1
|
||||
@ -103,16 +109,9 @@ AUTO 6
|
||||
.FIN
|
||||
.DO ]1=MLIGETBUF
|
||||
lda #2
|
||||
.FIN
|
||||
|
||||
.FIN
|
||||
jsr A2osX.MLICALL
|
||||
.EM
|
||||
*--------------------------------------
|
||||
.MA LIBCALL
|
||||
ldy ]1
|
||||
ldx #]2
|
||||
jsr A2osX.LIBCALL
|
||||
.EM
|
||||
*--------------------------------------
|
||||
* D.STACK PUSH/PULL Macros
|
||||
*--------------------------------------
|
||||
|
@ -17,8 +17,7 @@ CORE.Run jsr CORE.TskMgrRun
|
||||
jsr CORE.DispatchEvents
|
||||
bcc .4 CC=All Events Dispatched
|
||||
|
||||
>LDYAI TskMgr.Table Select PS0
|
||||
>STYA pPs
|
||||
jsr PS.Select0
|
||||
|
||||
lda #EvtMgr.Table
|
||||
sta pEvent
|
||||
@ -48,7 +47,9 @@ CORE.Run jsr CORE.TskMgrRun
|
||||
sta SYS.BASL0+38
|
||||
dex
|
||||
bpl .5
|
||||
|
||||
ldx #3
|
||||
|
||||
.5 stx SYS.CPULOADI
|
||||
|
||||
.6 bit OPENAPPLE
|
||||
@ -63,27 +64,8 @@ CORE.Run jsr CORE.TskMgrRun
|
||||
cmp #"5"
|
||||
bcs CORE.Run
|
||||
|
||||
sta KBDSTROBE
|
||||
|
||||
and #$0F
|
||||
cmp A2osX.ASCREEN Same as active screen...nothing to do
|
||||
beq CORE.Run
|
||||
|
||||
tax
|
||||
|
||||
lda A2osX.SCRNDEVS-1,x
|
||||
beq CORE.Run No device claimed this screen
|
||||
|
||||
jsr K.GetDevByID.A x unmodified.....
|
||||
bcs CORE.Run ???
|
||||
|
||||
stx A2osX.ASCREEN
|
||||
|
||||
>STYA pDev
|
||||
|
||||
ldx #DEVMGR.CONTROL
|
||||
jsr pDevJmp
|
||||
jmp CORE.Run
|
||||
jsr CORE.ScreenSelect
|
||||
bra CORE.Run
|
||||
*--------------------------------------
|
||||
CORE.DumpEvent ldy #S.EVT-1
|
||||
|
||||
@ -96,6 +78,30 @@ CORE.DumpEvent ldy #S.EVT-1
|
||||
|
||||
.2 >CSTR "!Evt:F=%b,Dev=$%h,LO=$%h,HI=$%h,W1=$%H,W2=$%H\n"
|
||||
*--------------------------------------
|
||||
CORE.ScreenSelect
|
||||
sta KBDSTROBE
|
||||
|
||||
and #$0F
|
||||
cmp A2osX.ASCREEN Same as active screen...nothing to do
|
||||
beq .8
|
||||
|
||||
tax
|
||||
|
||||
lda A2osX.SCRNDEVS-1,x
|
||||
beq .8 No device claimed this screen
|
||||
|
||||
jsr K.GetDevByID.A x unmodified.....
|
||||
bcs .8 ???
|
||||
|
||||
stx A2osX.ASCREEN
|
||||
|
||||
>STYA pDev
|
||||
|
||||
ldx #DEVMGR.CONTROL
|
||||
jmp pDevJmp
|
||||
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
SYS.CPULOADI .BS 1
|
||||
SYS.CPULOADC .AS "|/-\"
|
||||
*--------------------------------------
|
||||
@ -185,6 +191,70 @@ CORE.TskMgrRun >LDYAI TskMgr.Table+S.PS skip PS 0
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
* CORE.GetEvents :
|
||||
* IN :
|
||||
* OUT :
|
||||
* CS = no event, A = ERROR
|
||||
* CC * event in YA
|
||||
* (pEvent)
|
||||
*--------------------------------------
|
||||
CORE.GetEvents lda #EvtMgr.Table
|
||||
sta pEvent point to start of event list
|
||||
|
||||
stz EvtMgr.Count reset Size
|
||||
|
||||
lda K.IrkMgr.VBL do we have IRQ enabled for VBL ?
|
||||
bpl .10 no, regular poll
|
||||
|
||||
lda K.IrkMgr.VBLINT
|
||||
beq .3 no
|
||||
|
||||
dec K.IrkMgr.VBLINT
|
||||
bra .11
|
||||
|
||||
.10 lda VBL get VLINE status
|
||||
tax
|
||||
eor EvtMgr.VBLState
|
||||
bpl .3 no change,no tick
|
||||
txa
|
||||
sta EvtMgr.VBLState save new
|
||||
bpl .3 Up2down transition,no tick
|
||||
|
||||
.11 inc A2osX.TIMER16
|
||||
bne .1
|
||||
inc A2osX.TIMER16+1
|
||||
|
||||
.1 dec EvtMgr.HZ.CNT
|
||||
bne .3 not yet 100ms
|
||||
|
||||
ldx A2osX.HZ
|
||||
stx EvtMgr.HZ.CNT
|
||||
|
||||
lda #S.EVT.F.T10TH
|
||||
|
||||
dec EvtMgr.10TH.CNT
|
||||
bne .2
|
||||
|
||||
ldx #10
|
||||
stx EvtMgr.10TH.CNT
|
||||
|
||||
ora #S.EVT.F.T1SEC
|
||||
|
||||
.2 sta (pEvent)
|
||||
inc EvtMgr.Count Add one event to Queue
|
||||
|
||||
lda pEvent
|
||||
clc
|
||||
adc #S.EVT
|
||||
sta pEvent if CS, EVT queue full!!! ($100)
|
||||
|
||||
.3 sec
|
||||
lda EvtMgr.Count if 0, exit with CS (from cmp), and A=0 "no event"
|
||||
beq .9
|
||||
|
||||
.8 clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CORE.PSWakeUp and #$FF^S.PS.F.SLEEP unmark as SLEEP
|
||||
sta (pPS)
|
||||
|
||||
@ -280,74 +350,6 @@ CORE.TskMgrQuit clc
|
||||
TskMgr.Idx .BS 1
|
||||
TSKMGR.EVENTCNT .BS 1
|
||||
*--------------------------------------
|
||||
* CORE.GetEvents :
|
||||
* IN :
|
||||
* OUT :
|
||||
* CS = no event, A = ERROR
|
||||
* CC * event in YA
|
||||
* (pEvent)
|
||||
*--------------------------------------
|
||||
CORE.GetEvents lda #EvtMgr.Table
|
||||
sta pEvent point to start of event list
|
||||
|
||||
stz EvtMgr.Count reset Size
|
||||
|
||||
lda K.IrkMgr.VBL do we have IRQ enabled for VBL ?
|
||||
bpl .10 no, regular poll
|
||||
|
||||
lda K.IrkMgr.VBLINT
|
||||
beq .3 no
|
||||
|
||||
dec K.IrkMgr.VBLINT
|
||||
bra .11
|
||||
|
||||
.10 lda VBL get VLINE status
|
||||
tax
|
||||
eor EvtMgr.VBLState
|
||||
bpl .3 no change,no tick
|
||||
txa
|
||||
sta EvtMgr.VBLState save new
|
||||
bpl .3 Up2down transition,no tick
|
||||
|
||||
.11 inc A2osX.TIMER16
|
||||
bne .1
|
||||
inc A2osX.TIMER16+1
|
||||
|
||||
.1 dec EvtMgr.HZ.CNT
|
||||
bne .3 not yet 100ms
|
||||
|
||||
ldx A2osX.HZ
|
||||
stx EvtMgr.HZ.CNT
|
||||
|
||||
lda #S.EVT.F.T10TH
|
||||
|
||||
dec EvtMgr.10TH.CNT
|
||||
bne .2
|
||||
|
||||
ldx #10
|
||||
stx EvtMgr.10TH.CNT
|
||||
|
||||
ora #S.EVT.F.T1SEC
|
||||
|
||||
.2 sta (pEvent)
|
||||
jsr CORE.GetEvents.Add
|
||||
.3
|
||||
sec
|
||||
lda EvtMgr.Count if 0, exit with CS (from cmp), and A=0 "no event"
|
||||
beq .9
|
||||
|
||||
.8 clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CORE.GetEvents.Add
|
||||
inc EvtMgr.Count Add one event to Queue
|
||||
|
||||
lda pEvent
|
||||
clc
|
||||
adc #S.EVT
|
||||
sta pEvent
|
||||
rts if CS, EVT queue full!!! ($100)
|
||||
*--------------------------------------
|
||||
CORE.DestroyEvent
|
||||
lda (pEvent)
|
||||
beq .9
|
||||
|
@ -29,7 +29,13 @@ AUTO 6
|
||||
*--------------------------------------
|
||||
jmp A2osX.MLICALL1
|
||||
*--------------------------------------
|
||||
jmp * SPARE
|
||||
* MLICALL (AUXLC to MAINLC)
|
||||
* Used by Kernel
|
||||
* In:
|
||||
* X = MLI Function
|
||||
* A = Param Count
|
||||
*--------------------------------------
|
||||
jmp A2osX.ROMCALL1
|
||||
*--------------------------------------
|
||||
* BADCALL
|
||||
*--------------------------------------
|
||||
@ -95,6 +101,8 @@ A2osX.MLICALL1 stx .1
|
||||
jsr GO.A2osX
|
||||
rts
|
||||
*--------------------------------------
|
||||
A2osX.ROMCALL1 bra *
|
||||
*--------------------------------------
|
||||
* A2osX.DIIDrv
|
||||
* X = DEVMGR.cmd
|
||||
* Y,A = PTR to Params
|
||||
|
@ -77,7 +77,7 @@ Kernel.Init2 >LDAXI MSG.Init2
|
||||
jsr Kernel.Move
|
||||
|
||||
>LDYAI K.STACK
|
||||
>STYA pStack init Soft Stack
|
||||
>STYA pStack init Kernel Soft Stack
|
||||
|
||||
sta CLRALTZP Make MAIN ZP is enabled for X.PRINT.F
|
||||
|
||||
@ -107,28 +107,18 @@ Kernel.Init3 sta SETALTZP
|
||||
>LDYAI MSG.Init3
|
||||
>SYSCALL PrintF.YA
|
||||
|
||||
>LDYAI MSG.DEV
|
||||
>SYSCALL PrintF.YA
|
||||
jsr DevMgrInit
|
||||
bcs *
|
||||
|
||||
>LDYAI MSG.IRQ
|
||||
>SYSCALL PrintF.YA
|
||||
jsr IrqMgrInit
|
||||
bcs *
|
||||
|
||||
>LDYAI MSG.EVT
|
||||
>SYSCALL PrintF.YA
|
||||
jsr EvtMgrInit
|
||||
bcs *
|
||||
|
||||
>LDYAI MSG.FLT
|
||||
>SYSCALL PrintF.YA
|
||||
jsr FltMgrInit
|
||||
bcs *
|
||||
|
||||
>LDYAI MSG.TSK
|
||||
>SYSCALL PrintF.YA
|
||||
jsr TskMgrInit
|
||||
bcs *
|
||||
|
||||
@ -463,7 +453,9 @@ SETMOUSE .EQ $12 Sets mouse mode
|
||||
SERVEMOUSE .EQ $13 Services mouse interrupt
|
||||
READMOUSE .EQ $14 Reads mouse position
|
||||
*--------------------------------------
|
||||
IrqMgrInit php
|
||||
IrqMgrInit >LDYAI MSG.IRQ
|
||||
>SYSCALL PrintF.YA
|
||||
php
|
||||
sei
|
||||
>LDYA $FFFE
|
||||
>STYA K.IrqMgrOldFFFE
|
||||
@ -548,13 +540,18 @@ IrqMgrInit php
|
||||
inc K.IrkMgr.VBL set=1 awaiting IrqMgr confirmation
|
||||
|
||||
plp
|
||||
>LDYAI MSG.IRQ.VBL
|
||||
>SYSCALL PrintF.YA
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
Mouse.OFS .HS 05070B0CFB
|
||||
Mouse.SIG .HS 38180120D6
|
||||
*--------------------------------------
|
||||
DevMgrInit stz ZPPtr1
|
||||
DevMgrInit >LDYAI MSG.DEV
|
||||
>SYSCALL PrintF.YA
|
||||
|
||||
stz ZPPtr1
|
||||
lda #$C1
|
||||
sta ZPPtr1+1
|
||||
lda #1
|
||||
@ -729,7 +726,9 @@ SP.DEV.STATUS.DEVID
|
||||
SP.DEV.STATUS.DATA
|
||||
.BS S.DEVSTAT
|
||||
*--------------------------------------
|
||||
EvtMgrInit lda #$A5
|
||||
EvtMgrInit >LDYAI MSG.EVT
|
||||
>SYSCALL PrintF.YA
|
||||
lda #$A5
|
||||
sta A2osX.TIMER16
|
||||
lda #$9B
|
||||
sta A2osX.TIMER16+1
|
||||
@ -739,11 +738,15 @@ EvtMgrInit lda #$A5
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
FltMgrInit stz FltMgr.Table
|
||||
FltMgrInit >LDYAI MSG.FLT
|
||||
>SYSCALL PrintF.YA
|
||||
stz FltMgr.Table
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
TskMgrInit >LDYAI TskMgr.Table+S.PS Clear whole process table except PS0
|
||||
TskMgrInit >LDYAI MSG.TSK
|
||||
>SYSCALL PrintF.YA
|
||||
>LDYAI TskMgr.Table+S.PS Clear whole process table except PS0
|
||||
>STYA .2+1
|
||||
|
||||
ldx #K.PS.MAX-1
|
||||
@ -813,6 +816,7 @@ MSG.Init2.OK >CSTR "A2osX[Stage2]:Complete.\n"
|
||||
MSG.Init3 >CSTR "A2osX[Stage3]:Init\r\n"
|
||||
MSG.DEV >CSTR "-Device Manager...\r\n"
|
||||
MSG.IRQ >CSTR "-Interrupt Manager...\r\n"
|
||||
MSG.IRQ.VBL >CSTR " (VBL IRQ Activated)\r\n"
|
||||
MSG.EVT >CSTR "-Event Manager...\r\n"
|
||||
MSG.FLT >CSTR "-Path Filter...\r\n"
|
||||
MSG.TSK >CSTR "-Task Manager...\r\n"
|
||||
|
@ -8,11 +8,8 @@ AUTO 6
|
||||
*--------------------------------------
|
||||
ZPMemMgrSPtr .EQ ZPMEMMGR Pointer To Slot selected
|
||||
ZPMemMgrTmp1 .EQ ZPMEMMGR+2
|
||||
ZPMemMgrSrcPtr .EQ ZPMEMMGR+4
|
||||
ZPMemMgrDstPtr .EQ ZPMEMMGR+6
|
||||
*--------------------------------------
|
||||
MemMgr.ReqSize .EQ ZPMEMMGR+8 store requested Size
|
||||
MemMgr.ReqFlags .EQ ZPMEMMGR+10 store requested Flags
|
||||
MemMgr.ReqSize .EQ ZPMEMMGR+4 store requested Size
|
||||
MemMgr.ReqFlags .EQ ZPMEMMGR+6 store requested Flags
|
||||
*--------------------------------------
|
||||
* TODO :
|
||||
* - Create a 256 bytes table
|
||||
@ -456,12 +453,12 @@ K.SetLoMem
|
||||
* ## Out:
|
||||
* Buffer filled with memory stats
|
||||
*\--------------------------------------
|
||||
K.GetMemStat.YA >STYA ZPMemMgrDstPtr
|
||||
K.GetMemStat.YA >STYA ZPMemMgrTmp1
|
||||
|
||||
ldy #6
|
||||
|
||||
.1 lda MemMgr.Table,y
|
||||
sta (ZPMemMgrDstPtr),y
|
||||
sta (ZPMemMgrTmp1),y
|
||||
dey
|
||||
bpl .1
|
||||
|
||||
@ -472,7 +469,7 @@ K.GetMemStat.YA >STYA ZPMemMgrDstPtr
|
||||
sta SETREADAUX
|
||||
|
||||
.2 lda MemMgr.Table,x
|
||||
sta (ZPMemMgrDstPtr),y
|
||||
sta (ZPMemMgrTmp1),y
|
||||
dey
|
||||
dex
|
||||
bpl .2
|
||||
@ -483,7 +480,7 @@ K.GetMemStat.YA >STYA ZPMemMgrDstPtr
|
||||
ldy #22
|
||||
|
||||
.3 lda DevMgr.Stat,x
|
||||
sta (ZPMemMgrDstPtr),y
|
||||
sta (ZPMemMgrTmp1),y
|
||||
dey
|
||||
dex
|
||||
bpl .3
|
||||
|
@ -92,25 +92,15 @@ K.CreateProcess.YA
|
||||
stx K.CreateProcess.Flags
|
||||
>STYA K.CreateProcess.CmdLine
|
||||
|
||||
jsr PS.CreateChild
|
||||
jsr PS.CreateChild Child S.PS at ZPPtr3
|
||||
bcs .9
|
||||
|
||||
sta .8+1
|
||||
|
||||
>LDYA K.CreateProcess.CmdLine
|
||||
jsr PS.CmdLine2Args
|
||||
jsr PS.CmdLine2Args Y,A = Args[0]
|
||||
bcs .9
|
||||
|
||||
phy save PTR to Args[0]...
|
||||
pha
|
||||
|
||||
txa
|
||||
ldy #S.PS.hARGS
|
||||
sta (ZPPtr3),y
|
||||
|
||||
pla Restore PTR...
|
||||
ply
|
||||
|
||||
|
||||
jsr PS.Init
|
||||
bcc .8
|
||||
|
||||
@ -190,7 +180,7 @@ PS.CreateChild >LDYAI TskMgr.Table+S.PS
|
||||
ldy #S.PS.hPREFIX copy hPREFIX...
|
||||
lda (pPs),y
|
||||
jsr K.GetMemPtr.A
|
||||
jsr K.NewPStr.YA
|
||||
jsr K.NewCStr.YA
|
||||
bcs .9
|
||||
|
||||
txa
|
||||
@ -267,11 +257,15 @@ PS.CmdLine2Args >STYA ZPPtr1
|
||||
|
||||
.3 jsr K.GetMem.YA
|
||||
bcs .9
|
||||
phx save hMem
|
||||
|
||||
phy save PTR.LO
|
||||
pha save PTR.HI
|
||||
>STYA ZPPtr2
|
||||
|
||||
txa
|
||||
ldy #S.PS.hARGS
|
||||
sta (ZPPtr3),y
|
||||
|
||||
stz PS.CmdLine2Args.bInQuote
|
||||
|
||||
ldy #0
|
||||
@ -306,9 +300,13 @@ PS.CmdLine2Args >STYA ZPPtr1
|
||||
.8 lda #0
|
||||
sta (ZPPtr2) set Array Ending 0
|
||||
|
||||
txa
|
||||
ldy #S.PS.ARGC
|
||||
sta (ZPPtr3),y
|
||||
|
||||
pla get back PTR.HI
|
||||
ply get back PTR.LO
|
||||
plx get back hMem
|
||||
|
||||
clc
|
||||
.9 rts
|
||||
|
||||
@ -341,18 +339,21 @@ PS.Init jsr BIN.Load.YA Y,A=filename full path
|
||||
ldy #S.PS.hDS
|
||||
sta (ZPPtr3),y save DS hMem in TSKSLOT
|
||||
|
||||
.2 ldy #H.BIN.EXE.SS.SIZE+1
|
||||
lda (ZPPtr4),y Load DS.SIZE HI
|
||||
tax
|
||||
dey
|
||||
ora (ZPPtr4),y
|
||||
.2 ldy #H.BIN.EXE.SS.SIZE
|
||||
lda (ZPPtr4),y Load SS.SIZE.LO
|
||||
pha
|
||||
|
||||
beq * SS.SIZE=0!!!!
|
||||
dec
|
||||
|
||||
lda (ZPPtr4),y
|
||||
tay
|
||||
txa Y,A = DS.SIZE
|
||||
jsr K.GetMem0.YA
|
||||
ldy #S.PS.SP
|
||||
sta (ZPPtr3),y
|
||||
|
||||
phy SS.SIZE.LO....
|
||||
|
||||
bne .3 SS.SIZE=0, set as default $100
|
||||
inc SS.SIZE.HI
|
||||
|
||||
.3 jsr K.GetMem0.YA
|
||||
bcs .9
|
||||
|
||||
txa
|
||||
@ -399,6 +400,13 @@ PS.Free.A.PsY lda (ZPPtr1),y
|
||||
beq PS.Free.A.RTS
|
||||
jmp K.FreeMem.A
|
||||
*--------------------------------------
|
||||
PS.Select0 >LDYAI TskMgr.Table Select PS0
|
||||
>STYA pPs
|
||||
|
||||
lda K.STACK+$ff
|
||||
>STYA pStack
|
||||
rts
|
||||
*--------------------------------------
|
||||
PS.Select ldy #S.PS.hCS
|
||||
lda (pPs),y
|
||||
|
||||
@ -419,7 +427,26 @@ PS.Select ldy #S.PS.hCS
|
||||
jsr K.GetMemPtr.A
|
||||
>STYA pStack
|
||||
|
||||
iny
|
||||
* ldy #S.PS.SP
|
||||
lda pStack
|
||||
clc
|
||||
adc (pPs),y
|
||||
sta pStack
|
||||
bcc .8
|
||||
inc pStack+1
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
PS.Leave ldy #S.PS.hSS
|
||||
lda (pPs),y
|
||||
jsr K.GetMemPtr.A
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
rts
|
||||
*--------------------------------------
|
||||
* PS.DupEnv.A
|
||||
|
@ -18,7 +18,6 @@ ZPPtr1 .EQ ZPKERNEL
|
||||
ZPPtr2 .EQ ZPKERNEL+2
|
||||
ZPPtr3 .EQ ZPKERNEL+4
|
||||
ZPPtr4 .EQ ZPKERNEL+6
|
||||
ZPPStr1 .EQ ZPKERNEL+8
|
||||
|
||||
.INB /A2OSX.SRC/SYS/KERNEL.S.INIT
|
||||
.INB /A2OSX.SRC/X.PRINTF.S
|
||||
|
Loading…
x
Reference in New Issue
Block a user