Kernel 0.92

This commit is contained in:
Rémy GIBERT 2018-11-23 08:02:00 +01:00
parent 83d642c806
commit b2a3dc25fe

View File

@ -57,19 +57,26 @@ K.ExecL sty .1+1
K.ExecV >STYA PS.ArgV K.ExecV >STYA PS.ArgV
>PULLB PS.Flags >PULLB PS.Flags
PS.Exec jsr PS.CreateChild Child S.PS at ZPPtr3 PS.Exec stz PS.Load.hBIN
jsr PS.CreateChild Child S.PS at ZPPtr3
bcs .9 bcs .9
sta .8+1 sta .8+1
jsr PS.Load jsr PS.Load
bcs .99 bcs .90
jsr PS.AddArgV jsr PS.AddArgV
bcc .8 bcc .8
.99 pha save error code .90 pha save error code
lda .8+1 lda PS.Load.hBIN
beq .91
jsr K.FreeMem
.91 lda .8+1
jsr CORE.PSFree jsr CORE.PSFree
pla get back error code pla get back error code
sec sec
@ -248,6 +255,10 @@ PS.Load >PUSHWI K.S.STAT
bne .4 bne .4
>LDYAI K.Buf256 >LDYAI K.Buf256
>SYSCALL NewStr
bcs .99
stx PS.Load.hBIN
bra PS.LoadBIN.YA bra PS.LoadBIN.YA
.97 lda #E.BADPATH .97 lda #E.BADPATH
@ -371,9 +382,61 @@ PS.LoadGetHeader
*-------------------------------------- *--------------------------------------
PS.Load.ROOT .AZ "ROOT" PS.Load.ROOT .AZ "ROOT"
PS.Load.HEADER .AZ "#!/" PS.Load.HEADER .AZ "#!/"
PS.Load.hBIN .BS 1
PS.Load.ArgSize .BS 2
*-------------------------------------- *--------------------------------------
PS.AddArgV >LDYA PS.ArgV * hBIN + PS.ArgV -> #S.PS.hARGV
jsr PS.DupArgs *--------------------------------------
PS.AddArgV stz PS.Load.ArgSize
stz PS.Load.ArgSize+1
lda PS.Load.hBIN
beq .10
jsr K.GetMemPtr
>STYA PS.Load.ArgSize
>LDYA PS.ArgV
>STYA ZPPtr1
>STYA ZPPtr2
.1 lda (ZPPtr2)
beq .4
ldy #0
.2 iny
lda (ZPPtr2),y
bne .2
tya
sec
adc PS.Load.ArgSize
sta PS.Load.ArgSize
bcc .3
inc PS.Load.ArgSize+1
.3 tya
sec
adc ZPPtr2
sta ZPPtr2
bcc .1
inc ZPPtr2+1
bra .1
.4 >LDYA PS.Load.ArgSize
iny
bne .5
inc
jsr K.GetMem
bcs .9
bcs .9 bcs .9
ldy #S.PS.hARGV ldy #S.PS.hARGV
sta (ZPPtr3),y sta (ZPPtr3),y