Kernel 0.93++

This commit is contained in:
Rémy GIBERT 2020-01-29 17:46:51 +01:00
parent abadd5440a
commit 1ec69493f5
5 changed files with 77 additions and 127 deletions

Binary file not shown.

View File

@ -415,13 +415,13 @@ S.DIB.T.CDROM .EQ $05 SCSI CD-ROM
S.DIB.T.TAPE .EQ $06 SCSI tape or other SCSI sequential device
S.DIB.T.HD .EQ $07 SCSI hard disk
* .EQ $08 Reserved
S.DIB.T.SPRINTER .EQ $09 SCSI printer
*S.DIB.T.SPRINTER .EQ $09 SCSI printer
S.DIB.T.5.25 .EQ $0A 5-1/4" disk
* .EQ $0B Reserved
* .EQ $0C Reserved
S.DIB.T.PRINTER .EQ $0D Printer
S.DIB.T.CLOCK .EQ $0E Clock
S.DIB.T.MODEM .EQ $0F Modem
*S.DIB.T.PRINTER .EQ $0D Printer
*S.DIB.T.CLOCK .EQ $0E Clock
*S.DIB.T.MODEM .EQ $0F Modem
S.DIB.T.DISKII .EQ $10
S.DIB.T.PRODOS .EQ $11
S.DIB.T.NIC .EQ $12 Network Interface Card

View File

@ -4,7 +4,7 @@ NEW
ENVX.PutEnv ldy #$ff
.1 iny
lda (TXTPTR),y NAME=
jsr SHARED.TXTPTR.GetY NAME=
beq .9
cmp #'='
@ -19,7 +19,7 @@ ENVX.PutEnv ldy #$ff
adc TXTPTR+1
sta FORPNT+1
bra K.SetEnv.I
bra ENVX.SetEnv
.9 lda #E.SYN
sec
@ -27,7 +27,7 @@ ENVX.PutEnv ldy #$ff
*--------------------------------------
ENVX.SetEnv jsr ENVX.UnsetEnv
.1 jsr ENV.InitEnvP3 ZPPtr3 -> Env (SETREADAUX)
.1 jsr ENVX.InitEnvP3 ZPPtr3 -> Env (SETREADAUX)
lda #1
sta ZPPtr4
@ -36,33 +36,29 @@ ENVX.SetEnv jsr ENVX.UnsetEnv
.10 lda (ZPPtr3) End of ENV
beq .15
jsr ENV.GetP3LenY
jsr ENV.NextEnvP3Y
jsr ENV.NextEnvP4Y
jsr ENVX.GetP3LenY
jsr ENVX.NextEnvP3Y
jsr ENVX.NextEnvP4Y
bra .10
.15 .DO AUXENV=1
sta CLRREADAUX
.FIN
ldy #$ff
.15 ldy #$ff
.16 iny
lda (TXTPTR),y
jsr SHARED.TXTPTR.GetY
beq .17
jsr SHARED.IsIDValid
bcc .16
.17 jsr ENV.NextEnvP4Y ZPPtr4 = ENVSIZE + VAR
.17 jsr ENVX.NextEnvP4Y ZPPtr4 = ENVSIZE + VAR
ldy #$ff
.19 iny
lda (FORPNT),y
jsr SHARED.FORPNT.getY
bne .19
jsr ENV.NextEnvP4Y ZPPtr4 = ENVSIZE + VALUE
jsr ENVX.NextEnvP4Y ZPPtr4 = ENVSIZE + VALUE
lda ZPPtr4
beq .20
@ -81,12 +77,7 @@ ENVX.SetEnv jsr ENVX.UnsetEnv
ldy #S.PS.hENV
lda (pPs),y
.DO AUXENV=1
ldx #SYS.FreeStkObj
jsr K.SYSCALL2.AUX
.ELSE
jsr K.Freemem
.FIN
jsr K.Freemem AUX
pla
ldy #S.PS.hENV
@ -97,13 +88,9 @@ ENVX.SetEnv jsr ENVX.UnsetEnv
bra .1 Start over
.22 ldy #$ff
.DO AUXENV=1
sta SETWRITEAUX
.FIN
.23 iny
lda (TXTPTR),y
jsr SHARED.TXTPTR.GetY
sta (ZPPtr3),y
beq .24
jsr SHARED.IsIDValid
@ -112,11 +99,11 @@ ENVX.SetEnv jsr ENVX.UnsetEnv
.24 lda #'='
sta (ZPPtr3),y
jsr ENV.NextEnvP3Y
jsr ENVX.NextEnvP3Y
ldy #$ff
.25 iny
lda (FORPNT),y
jsr SHARED.FORPNT.getY
sta (ZPPtr3),y
bne .25
@ -124,66 +111,49 @@ ENVX.SetEnv jsr ENVX.UnsetEnv
sta (ZPPtr3),y don't forget array ending 0
clc
.9 .DO AUXENV=1
sta CLRREADAUX
sta CLRWRITEAUX
.FIN
rts
.9 rts
*--------------------------------------
ENVX.GetEnv lda TXTPTR
beq K.GetEnvDump
beq ENVX.Dump
jsr ENV.FindVar
jsr ENVX.FindVar
bcs .9
jsr ENV.NextEnvP3Y Skip NAME=
jsr ENVX.NextEnvP3Y Skip NAME=
lda FORPNT+1
bne .3
ldy #$ff
.DO AUXENV=1
sta SETREADAUX
.FIN
.1 iny
lda (ZPPtr3),y
bne .1
.DO AUXENV=1
sta CLRREADAUX
.FIN
iny
bne .2
inc
.2 .DO AUXENV=1
sta CLRREADAUX
.2 sta CLRREADAUX
sta CLRWRITEAUX
.FIN
jsr K.getmem
sta SETREADAUX
sta SETWRITEAUX
bcs .99
>STYA FORPNT
.3 .DO AUXENV=1
sta SETREADAUX
.FIN
ldy #$ff
.3 ldy #$ff
.4 iny
lda (ZPPtr3),y
sta (FORPNT),y
jsr SHARED.FORPNT.PutY
bne .4
>LDYA FORPNT
.DO AUXENV=1
sta CLRREADAUX
.FIN
clc
rts
@ -191,13 +161,20 @@ ENVX.GetEnv lda TXTPTR
.9 >LDYAI 0
* sec
.99 rts
K.GetEnvDump ldy #S.PS.ENVPAGECNT
*--------------------------------------
ENVX.Dump sta CLRREADAUX
sta CLRWRITEAUX
ldy #S.PS.ENVPAGECNT
lda (pPs),y
sta .1+1
ldy #0
jsr K.getmem
sta SETREADAUX
sta SETWRITEAUX
bcs .9
>STYA FORPNT
@ -212,26 +189,27 @@ K.GetEnvDump ldy #S.PS.ENVPAGECNT
ldy #0
.2 lda (ZPPtr3),y
sta (FORPNT),y
jsr SHARED.FORPNT.PutY
iny
bne .2
inc ZPPtr3+1
inc FORPNT+1
dex
bne .2
.80 ldy #$ff SELF MODIFIED
.81 lda #$ff SELF MODIFIED
.82 ldx #$ff SELF MODIFIED
.DO AUXENV=1
sta CLRREADAUX
.FIN
clc
.9 rts
*--------------------------------------
ENVX.UnsetEnv jsr ENV.FindVar
ENVX.UnsetEnv jsr ENVX.FindVar
bcs . 8 not found, quit
jsr ENV.DelVarP3 Ptr3 -> NAME=VALUE
jsr ENVX.DelVarP3 Ptr3 -> NAME=VALUE
clc
rts
@ -248,13 +226,7 @@ ENVX.UnsetEnv jsr ENV.FindVar
* TXTPTR -> NAME
* ZPPtr3 -> PTR to Ending 0
*--------------------------------------
ENVX.FindVar
.DO AUXENV=1
sta SETREADAUX
sta SETWRITEAUX
.FIN
jsr ENV.InitEnvP3 Store ENV
ENVX.FindVar jsr ENVX.InitEnvP3 Store ENV
.1 lda (ZPPtr3)
beq .9 end of ENV
@ -262,11 +234,7 @@ ENVX.FindVar
ldy #$ff
.2 iny
.DO AUXENV=1
jsr SHARED.TXTPTR.GetY
.ELSE
lda (TXTPTR),y
.FIN
beq .3
jsr SHARED.IsIDValid
@ -281,34 +249,22 @@ ENVX.FindVar
cmp #'='
bne .4
.DO AUXENV=1
sta CLRREADAUX
sta CLRWRITEAUX
.FIN
clc
rts
.4 jsr ENV.NextEnvP3 Skip NAME=VALUE
.4 jsr ENVX.NextEnvP3 Skip NAME=VALUE
bra .1
.9 .DO AUXENV=1
sta CLRREADAUX
sta CLRWRITEAUX
.FIN
sec
.9 sec
rts
*--------------------------------------
* ENV.DelVarP3
* In:
* ZPPtr3 -> ENV.NAME to Discard
*--------------------------------------
ENV.DelVarP3 .DO AUXENV=1
sta SETREADAUX
sta SETWRITEAUX
.FIN
>LDYA ZPPtr3 save actual Ptr
ENVX.DelVarP3 >LDYA ZPPtr3 save actual Ptr
>STYA ZPPtr4
jsr ENV.NextEnvP3 Skip NAME=VALUE
jsr ENVX.NextEnvP3 Skip NAME=VALUE
.1 ldy #$ff
@ -321,46 +277,38 @@ ENV.DelVarP3 .DO AUXENV=1
beq .8 we moved back ending \0
jsr ENV.NextEnvP3Y
jsr ENV.NextEnvP4Y
jsr ENVX.NextEnvP3Y
jsr ENVX.NextEnvP4Y
bra .1
.8 .DO AUXENV=1
sta CLRREADAUX
sta CLRWRITEAUX
.FIN
rts
.8 rts
*--------------------------------------
ENV.InitEnvP3 .DO AUXENV=1
sta CLRREADAUX
.FIN
ENVX.InitEnvP3 sta CLRREADAUX
ldy #S.PS.hENV
lda (pPs),y
.DO AUXENV=1
sta SETREADAUX
.FIN
jsr K.GetMemPtr
>STYA ZPPtr3 Store ENV
rts
*--------------------------------------
ENV.NextEnvP3 jsr ENV.GetP3LenY
ENVX.NextEnvP3 jsr ENVX.GetP3LenY
*--------------------------------------
ENV.NextEnvP3Y tya
ENV.NextEnvP3A sec
ENVX.NextEnvP3Y tya
ENVX.NextEnvP3A sec
adc ZPPtr3
sta ZPPtr3
bcc .8
inc ZPPtr3+1
.8 rts
*--------------------------------------
ENV.GetP3LenY ldy #$ff
ENVX.GetP3LenY ldy #$ff
.1 iny
lda (ZPPtr3),y
bne .1
rts
*--------------------------------------
ENV.NextEnvP4Y tya
ENVX.NextEnvP4Y tya
sec
adc ZPPtr4
sta ZPPtr4
@ -386,10 +334,6 @@ ENV.Dup.A sta .8+1 Store target page Count
ldy #S.PS.hENV
lda (pPs),y
.DO AUXENV=1
sta SETREADAUX
sta SETWRITEAUX
.FIN
jsr K.GetMemPtr
>STYA .1+1
@ -420,11 +364,7 @@ ENV.Dup.A sta .8+1 Store target page Count
pla hMem
clc
.9 .DO AUXENV=1
sta CLRREADAUX
sta CLRWRITEAUX
.FIN
rts
.9 rts
*--------------------------------------
MAN
SAVE USR/SRC/SYS/KERNEL.S.ENVX

View File

@ -97,6 +97,12 @@ SHARED.TXTPTR.Next
inc TXTPTR+1
rts
*--------------------------------------
SHARED.FORPNT.getY
sta CLRREADAUX
sta (FORPNT),y
sta SETREADAUX
rts
*--------------------------------------
SHARED.FORPNT.PutY
sta CLRWRITEAUX
sta (FORPNT),y
@ -107,7 +113,7 @@ SHARED.FORPNT.PutNext
sta CLRWRITEAUX
sta (FORPNT)
sta SETWRITEAUX
* SHARED.FORPNT.Next
SHARED.FORPNT.Next
inc FORPNT
bne SHARED.RTS
inc FORPNT+1

View File

@ -174,17 +174,21 @@ K.Str2StrV jsr K.Expand
.3 cmp #C.SPACE
bne .6 regular char ...store...
tya
bmi .6 between quotes... store space...
bmi .4 between quotes... store space...
inx Found one arg !!!
lda #0 set this token End
jsr SHARED.PutCharPtr2
bra .1
.4 lda #C.SPACE
.6 jsr SHARED.PutCharPtr2
.7 jsr SHARED.GetCharPtr1
bne .2
inx
.8 jsr SHARED.PutCharPtr2 set Argv[x] Ending 0
sta (ZPPtr2) set Array Ending 0