Kernel 0.92

This commit is contained in:
Rémy GIBERT 2019-01-21 14:51:10 +00:00
parent eea4fb0809
commit d962d7b6ef
6 changed files with 58 additions and 30 deletions

Binary file not shown.

View File

@ -273,7 +273,7 @@ CL.PrintCmdBuf >LDYA ZPCLBuf
rts
*--------------------------------------
CL.GetLine >LDYA ZPFileBufPtr
>STYA.G ZPFileBufPtrBak
>STYA ZPFileBufPtrBak
lda (ZPFileBufPtr)
beq .9

View File

@ -1027,20 +1027,21 @@ CMD.IsSwitch >STYA ZPPtr1
sec
rts
*--------------------------------------
CMD.StkPushPtr >LDA.G ZPFileBufPtrBak
CMD.StkPushPtr lda ZPFileBufPtrBak
jsr CMD.StkPush
bcs .9
>LDA.G ZPFileBufPtrBak+1
jmp CMD.StkPush
bcs CMD.StkPullPtr.9
lda ZPFileBufPtrBak+1
bra CMD.StkPush
.9 rts
*--------------------------------------
CMD.StkPullPtr jsr CMD.StkPull
bcs .9
bcs CMD.StkPullPtr.9
sta ZPFileBufPtr+1
jsr CMD.StkPull
bcs .9
bcs CMD.StkPullPtr.9
sta ZPFileBufPtr
.9 rts
CMD.StkPullPtr.9
rts
*--------------------------------------
CMD.StkGetPtr lda (pData) StackPtr
beq .9

View File

@ -25,7 +25,9 @@ CORE.Run stz CORE.PSIndex
eor #S.PS.F.HOLD unmark as HOLD
sta (pPs)
.2 jsr CORE.PSExec INIT/RUN/QUIT/RESUME
.2 jsr CORE.PSSelect Restore ZP & Ptrs
.3 jsr CORE.PSExec INIT/RUN/QUIT/RESUME
dec IRQ.InKernel
bcc .61 Error ?
@ -56,7 +58,7 @@ CORE.Run stz CORE.PSIndex
and #$3F $ff^S.PS.F.INIT+S.PS.F.RUN
ora #S.PS.F.QUIT
sta (pPs)
bra .7
bra .3 try executing QUIT now...
.61 lda (pPs)
bit #S.PS.F.SLEEP
@ -74,7 +76,6 @@ CORE.Run stz CORE.PSIndex
ldy #S.PS.PID
lda (pPs),y
beq *
jsr CORE.PSFree
bra .8
@ -452,9 +453,7 @@ CORE.PSLeave ldy #S.PS.ZP+ZPBIN.SIZE-1
rts
*--------------------------------------
CORE.PSExec jsr CORE.PSSelect Restore ZP & Ptrs
lda (pPS)
CORE.PSExec lda (pPS)
bit #S.PS.F.SLEEP
bne CORE.PSResume

View File

@ -180,18 +180,16 @@ ENV.Search.DRV ldx #2
.HS 2C BIT ABS
ENV.Search.PATH ldx #4
sty .1+1
sta .2+1
>STYA ZPPtr1
>LDYA ENV.VARS,x
jsr K.GetEnv get value for Search Path
jsr ENV.FindVarP1 get value for Search Path
bcs K.FileSearch.RTS
>STYA ENV.SearchPath
.1 ldy #$ff SELF MODIFIED
.2 lda #$ff SELF MODIFIED
>LDYA ZPPtr1
ENV.Search.YA >STYA .4+1

View File

@ -19,7 +19,11 @@ ZPSListDataPtr .EQ ZPMEMMGR+14
* X = hMem
* CS :
* A = EC
*\--------------------------------------
*\--------------------------------------
MEM.ReqFlags .BS 1 store requested Flags
MEM.BestSlot .BS 1
MEM.BestScore .BS 2
*--------------------------------------
K.GetMem0 ldx #S.MEM.F.INIT0
.HS 2C bit abs
*/--------------------------------------
@ -34,7 +38,7 @@ K.GetMem0 ldx #S.MEM.F.INIT0
*\--------------------------------------
K.GetMem ldx #0
MEM.GetMem.YAX stx Mem.ReqFlags
MEM.GetMem.YAX stx MEM.ReqFlags
sta ZPMemMgrSize+1
tya
@ -52,6 +56,11 @@ MEM.GetMem.YAX stx Mem.ReqFlags
>LDYAI Mem.Table
>STYA ZPMemMgrSPtr
stz MEM.BestSlot
ldx #$ff
stx MEM.BestScore
stx MEM.BestScore+1
ldx #0 Current slot=0
bra .4 skip slot 0, Check if some free slot to reuse first
@ -61,7 +70,7 @@ MEM.GetMem.YAX stx Mem.ReqFlags
lda (ZPMemMgrSPtr) Get Flags
bmi .4 in use ?
.2 lda Mem.ReqFlags Found an empty slot
.2 lda MEM.ReqFlags Found an empty slot
and #S.MEM.F.ALIGN is request needs a page align ?
beq .3
@ -70,21 +79,44 @@ MEM.GetMem.YAX stx Mem.ReqFlags
bne .4 not page-aligned
.3 ldy #S.MEM.LEN
sec
lda (ZPMemMgrSPtr),y get LEN of this block
cmp ZPMemMgrSize compare with requested size
bne .4
sbc ZPMemMgrSize compare with requested size
pha
iny
lda (ZPMemMgrSPtr),y
cmp ZPMemMgrSize+1
beq .7 requested size matches slot size !!!
sbc ZPMemMgrSize+1
ply Y,A = SlotLen - ReqSize
bcc .4 req size > slot size
cpy MEM.BestScore
pha
sbc MEM.BestScore+1
pla
bcs .4 Delta is >= BestScore
bne .4 Delta is > 255...
sty MEM.BestScore
sta MEM.BestScore+1
stx MEM.BestSlot
.4 cpx Mem.LastSlot any other slot to check?
bne .1 last one, create a new slot
lda MEM.BestSlot
beq .5
tax
jsr K.GetMemByID
bra .7
*-------------- Create a New SLOT
.5 lda Mem.ReqFlags
.5 lda MEM.ReqFlags
and #S.MEM.F.ALIGN is request needs a page align ?
beq .6
@ -107,7 +139,7 @@ MEM.GetMem.YAX stx Mem.ReqFlags
*-------------- Reuse this SLOT
.7 lda Mem.ReqFlags get requested flags
.7 lda MEM.ReqFlags get requested flags
ora #S.MEM.F.INUSE mark as in use
sta (ZPMemMgrSPtr)
@ -164,8 +196,6 @@ MEM.GetMem.YAX stx Mem.ReqFlags
.9 rts
*--------------------------------------
Mem.ReqFlags .BS 1 store requested Flags
*--------------------------------------
* Mem.AddSlot
* In:
* Y,A = Requested size