Kernel version 0.8 : Old MLI API decom in progress

This commit is contained in:
Rémy GIBERT 2016-09-26 08:18:51 +02:00
parent d4868fe152
commit 7984c2ba74
17 changed files with 179 additions and 194 deletions

Binary file not shown.

Binary file not shown.

View File

@ -271,7 +271,7 @@ DIR.MA jsr SRC.GetArg
.1 jsr FIO.ReadLine .1 jsr FIO.ReadLine
bcs .99 bcs .99
lda TmpBuffer256 lda UsrBuf256
beq .1 beq .1
cmp #'*' Comment? cmp #'*' Comment?

View File

@ -160,12 +160,12 @@ FIO.ReadLine stz SRC.BufPtr
bmi .10 bmi .10
>PUSHWI 256 >PUSHWI 256
>PUSHWI TmpBuffer256 >PUSHWI UsrBuf256
jsr FIO.ReadFromFile jsr FIO.ReadFromFile
bcs .19 bcs .19
lda #0 replace ending $0D with $00 lda #0 replace ending $0D with $00
sta TmpBuffer256,y sta UsrBuf256,y
.19 rts .19 rts
.10 >PUSHWI 3 .10 >PUSHWI 3
@ -195,7 +195,7 @@ FIO.ReadLine stz SRC.BufPtr
.1 lda SRC.Buffer,y .1 lda SRC.Buffer,y
bmi .2 bmi .2
sta TmpBuffer256,x sta UsrBuf256,x
beq .8 Ending 00 beq .8 Ending 00
inx inx
beq .99 beq .99
@ -212,7 +212,7 @@ FIO.ReadLine stz SRC.BufPtr
beq .99 beq .99
.3 pha .3 pha
lda SRC.Buffer,y lda SRC.Buffer,y
sta TmpBuffer256,x sta UsrBuf256,x
pla pla
inx inx
beq .99 beq .99
@ -225,7 +225,7 @@ FIO.ReadLine stz SRC.BufPtr
.5 and #$3F Compute blank count .5 and #$3F Compute blank count
.6 pha .6 pha
lda #$20 lda #$20
sta TmpBuffer256,x sta UsrBuf256,x
pla pla
inx inx
beq .99 beq .99

View File

@ -18,7 +18,7 @@ SRC.PrintLine ldy #ASM.MACRO.ON
lda (pData),y lda (pData),y
bpl .9 bpl .9
.8 >PUSHWI TmpBuffer256 .8 >PUSHWI UsrBuf256
>PUSHW SRC.LINENUM >PUSHW SRC.LINENUM
ldy #ASM.PC+1 ldy #ASM.PC+1
>PUSHB (pData),y >PUSHB (pData),y
@ -29,7 +29,7 @@ SRC.PrintLine ldy #ASM.MACRO.ON
.9 rts .9 rts
*--------------------------------------- *---------------------------------------
SRC.PrintLineErr ldx #0 SRC.PrintLineErr ldx #0
.1 lda TmpBuffer256,x .1 lda UsrBuf256,x
beq .2 beq .2
phx phx
>SYSCALL SYS.COutA >SYSCALL SYS.COutA
@ -43,7 +43,7 @@ SRC.PrintLineErr ldx #0
bcs .9 bcs .9
ldx #0 ldx #0
.3 lda TmpBuffer256,x .3 lda UsrBuf256,x
beq .5 beq .5
inx inx
cpx SRC.BufPtr cpx SRC.BufPtr
@ -65,7 +65,7 @@ SRC.PrintLineErr ldx #0
>SYSCALL SYS.COutA >SYSCALL SYS.COutA
.9 rts .9 rts
*--------------------------------------- *---------------------------------------
SRC.ParseLine ldx TmpBuffer256 SRC.ParseLine ldx UsrBuf256
beq .1 beq .1
cpx #'*' Comment? cpx #'*' Comment?
@ -879,7 +879,7 @@ SRC.GetCharUC jsr SRC.GetChar
.9 rts .9 rts
*--------------------------------------- *---------------------------------------
SRC.GetChar ldx SRC.BufPtr SRC.GetChar ldx SRC.BufPtr
lda TmpBuffer256,x lda UsrBuf256,x
beq .9 beq .9
inc SRC.BufPtr if 255, will make Z inc SRC.BufPtr if 255, will make Z
.9 rts .9 rts

View File

@ -125,23 +125,35 @@ CS.RUN ldy #bCANCEL
.31 >LDYA ZPPtr1 .31 >LDYA ZPPtr1
>SYSCALL SYS.PStrOutYA >SYSCALL SYS.PStrOutYA
lda ZPPtr1 ldy #S.STAT.TYPE
sec lda (ZPPtr2),y
adc (ZPPtr1) cmp #$0F Directory ?
sta ZPPtr1 beq .32
bcc .4
inc ZPPtr1+1
.4 lda #13 pha
lda #'.'
>SYSCALL SYS.COutA >SYSCALL SYS.COutA
.7 lda ZPPtr1 pla
jsr FileType2PSTR
>SYSCALL SYS.PStrOutYA
.32
lda #13
>SYSCALL SYS.COutA
.7 lda ZPPtr2
clc clc
adc #S.STAT adc #S.STAT
sta ZPPtr1 sta ZPPtr1
bcc .3 lda ZPPtr2+1
inc ZPPtr1+1 adc #0
bcs .3 Always sta ZPPtr1+1
bra .3
.8 pla .8 pla
>SYSCALL SYS.FreeMemA >SYSCALL SYS.FreeMemA
@ -202,22 +214,53 @@ CS.QUIT ldy #hDIR
clc clc
rts rts
*-------------------------------------- *--------------------------------------
FileType2PSTR ldy #0
.1 cmp PRODOS.FT.HEX,y
beq .3
.2 iny
cpy #PRODOS.FT.TXT-PRODOS.FT.TXT
bne .1
pha
lsr
lsr
lsr
lsr
tax
lda HEXDIGIT,x
sta PRODOS.FT.DFLT+2
pla
and #$0F
tax
lda HEXDIGIT,x
sta PRODOS.FT.DFLT+3
.3 tya
asl
asl CC
adc L.PRODOS.FT.TXT
tay
lda L.PRODOS.FT.TXT+1
adc #0
rts
*--------------------------------------
CS.END CS.END
LIBSTR >PSTRING "libstr.o" LIBSTR >PSTRING "libstr.o"
MSG.VOL >CSTRING "/%S\n" MSG.VOL >CSTRING "/%S\n"
MSG.DIR >CSTRING "/%15S <dir> %a %T %t %T %t\n" MSG.DIR >CSTRING "/%15S <dir> %a %T %t %T %t\n"
MSG.FILE >CSTRING "%15S %S $%H %a %8L %T %t %T %t\n" MSG.FILE >CSTRING "%15S %S $%H %a %8L %T %t %T %t\n"
*-------------------------------------- *--------------------------------------
PRODOS.FT.COUNT .HS 07 PRODOS.FT.HEX .HS 0406FAFCFDE2FF
PRODOS.FT.ID .HS 0406FAFCFDE2FF PRODOS.FT.TXT >PSTRING "TXT"
PRODOS.FT.TXT >PSTRING "BIN"
T04 >PSTRING "TXT" >PSTRING "S-C"
T06 >PSTRING "BIN" >PSTRING "BAS"
TFA >PSTRING "S-C" >PSTRING "VAR"
TFC >PSTRING "BAS" >PSTRING "ATK"
TFD >PSTRING "VAR" >PSTRING "SYS"
TE2 >PSTRING "ATK"
TFF >PSTRING "SYS"
PRODOS.FT.DFLT >PSTRING "$ " PRODOS.FT.DFLT >PSTRING "$ "
HEXDIGIT .AS '0123456789ABCDEF' HEXDIGIT .AS '0123456789ABCDEF'
hLIBSTR .BS 1 hLIBSTR .BS 1

View File

@ -48,7 +48,7 @@ A2osX.SaveSX .EQ $101 Aux
* Aux $200 -> 3FD : /RAM Driver * Aux $200 -> 3FD : /RAM Driver
* Aux $3FE -> 3FF : IRQ Vector * Aux $3FE -> 3FF : IRQ Vector
*-------------------------------------- *--------------------------------------
TmpBuffer256 .EQ $0200 Main UsrBuf256 .EQ $0200 Main
*-------------------------------------- *--------------------------------------
* $12 bytes min !!!! * $12 bytes min !!!!
*-------------------------------------- *--------------------------------------
@ -62,7 +62,7 @@ D.STACK.TOP .EQ $03F0 ...Down to $0300
* Main/Aux $400 -> $7FF : Console Screen * Main/Aux $400 -> $7FF : Console Screen
* Main/Aux $800 -> $BFF : System Screen * Main/Aux $800 -> $BFF : System Screen
*-------------------------------------- *--------------------------------------
KrnBuffer256 .EQ $0C00 KrnBuf256 .EQ $0C00
*-------------------------------------- *--------------------------------------
*** Z80 Reserved $0F00-10FF*** *** Z80 Reserved $0F00-10FF***
*-------------------------------------- *--------------------------------------
@ -177,18 +177,7 @@ SYS.GetEnvYA .EQ $3C
SYS.UnsetEnvYA .EQ $3E SYS.UnsetEnvYA .EQ $3E
*-------------------------------------- *--------------------------------------
SYS.MLICreateFile .EQ $40 SYS.MLICreateFile .EQ $40
SYS.MLISetFileInfo .EQ $4C
SYS.MLIGetFileInfoYA .EQ $50 SYS.MLIGetFileInfoYA .EQ $50
SYS.MLIOnline .EQ $52
SYS.MLISetPrefixYA .EQ $56
SYS.MLIGetPrefixYA .EQ $5A SYS.MLIGetPrefixYA .EQ $5A
@ -198,21 +187,6 @@ SYS.MLINewLine .EQ $60
SYS.MLIRead .EQ $62 SYS.MLIRead .EQ $62
SYS.MLIWrite .EQ $64 SYS.MLIWrite .EQ $64
SYS.MLICloseA .EQ $66 SYS.MLICloseA .EQ $66
SYS.MLIFlushA .EQ $68
SYS.MLISetMark .EQ $6A
SYS.MLIGetMarkA .EQ $6A
SYS.MLISetEOF .EQ $6C
SYS.MLIGetEOFA .EQ $70
SYS.MLISetBuf .EQ $72
SYS.MLIGetBuf .EQ $74
SYS.MLIAllocIRQ .EQ $78
SYS.MLIDeallocIRQ .EQ $7A
SYS.MLIReadBlock .EQ $7C
SYS.MLIWriteBlock .EQ $7E
*-------------------------------------- *--------------------------------------
SYS.GetDevByIDA .EQ $80 SYS.GetDevByIDA .EQ $80

View File

@ -354,13 +354,13 @@ GetDHCPOption cmp #S.DHCP.OPTIONS.MASK
.4 iny .4 iny
inx inx
lda (ZPFramePtr),y lda (ZPFramePtr),y
sta TmpBuffer256,x sta UsrBuf256,x
bne .4 bne .4
ldy #S.IPCFG.DOMAIN-1 ldy #S.IPCFG.DOMAIN-1
ldx #$FF ldx #$FF
.5 iny .5 iny
inx inx
lda TmpBuffer256,x lda UsrBuf256,x
sta IPCFG,y sta IPCFG,y
bne .5 bne .5
@ -371,14 +371,14 @@ GetDHCPOption.CopyIP
ldy #2 ldy #2
ldx #0 ldx #0
.1 lda (ZPFramePtr),y .1 lda (ZPFramePtr),y
sta TmpBuffer256,x sta UsrBuf256,x
iny iny
inx inx
cpx #4 cpx #4
bne .1 bne .1
ply ply
ldx #0 ldx #0
.2 lda TmpBuffer256,x .2 lda UsrBuf256,x
sta IPCFG,y sta IPCFG,y
iny iny
inx inx

View File

@ -114,7 +114,7 @@ Cmd.Exec.EXT ldy #1
pla pla
>SYSCALL SYS.FreeMemA Discard this string... >SYSCALL SYS.FreeMemA Discard this string...
.3 stz TmpBuffer256 reset TmpBuffer256 for final CMDLINE .3 stz UsrBuf256 reset UsrBuf256 for final CMDLINE
>LDYA L.CMD >LDYA L.CMD
>SYSCALL SYS.MLIGetFileInfoYA >SYSCALL SYS.MLIGetFileInfoYA
@ -142,34 +142,34 @@ Cmd.Exec.EXT.TXT
lda #0 Get arg[0] = /PATH/SHELL lda #0 Get arg[0] = /PATH/SHELL
>SYSCALL SYS.GetArgA >SYSCALL SYS.GetArgA
>PUSHYA >PUSHYA
>PUSHWI TmpBuffer256 >PUSHWI UsrBuf256
>SYSCALL SYS.PStrCpy >SYSCALL SYS.PStrCpy
inc TmpBuffer256 Add a space.... inc UsrBuf256 Add a space....
ldy TmpBuffer256 ldy UsrBuf256
lda #' ' lda #' '
sta TmpBuffer256,y sta UsrBuf256,y
*-------------------------------------- *--------------------------------------
* BIN : Launch "/PATH/CMD ARGS" * BIN : Launch "/PATH/CMD ARGS"
*-------------------------------------- *--------------------------------------
Cmd.Exec.EXT.BIN Cmd.Exec.EXT.BIN
>PUSHW L.CMD >PUSHW L.CMD
>PUSHWI TmpBuffer256 >PUSHWI UsrBuf256
>SYSCALL SYS.PStrCat >SYSCALL SYS.PStrCat
lda ARGS lda ARGS
beq .1 beq .1
inc TmpBuffer256 Add a space.... inc UsrBuf256 Add a space....
ldy TmpBuffer256 ldy UsrBuf256
lda #' ' lda #' '
sta TmpBuffer256,y sta UsrBuf256,y
>PUSHW L.ARGS >PUSHW L.ARGS
>PUSHWI TmpBuffer256 >PUSHWI UsrBuf256
>SYSCALL SYS.PStrCat >SYSCALL SYS.PStrCat
.1 >LDYAI TmpBuffer256 .1 >LDYAI UsrBuf256
bit Cmd.Exec.Mode bit Cmd.Exec.Mode
bmi .2 startproc bmi .2 startproc
@ -203,7 +203,7 @@ Cmd.Exec.CD1 lda ARGS+1
lda (pPs),y lda (pPs),y
>SYSCALL SYS.GetMemPtrA >SYSCALL SYS.GetMemPtrA
>PUSHYA >PUSHYA
>PUSHWI TmpBuffer256 >PUSHWI UsrBuf256
>SYSCALL SYS.PStrCpy >SYSCALL SYS.PStrCpy
lda ARGS+1 lda ARGS+1
@ -214,18 +214,18 @@ Cmd.Exec.CD1 lda ARGS+1
bne .9 bne .9
ldy TmpBuffer256 remove last dir component in actual prefix ldy UsrBuf256 remove last dir component in actual prefix
.2 dey .2 dey
beq .9 nothing to remove, synerr beq .9 nothing to remove, synerr
lda TmpBuffer256,y lda UsrBuf256,y
cmp #'/' cmp #'/'
bne .2 bne .2
sty TmpBuffer256 sty UsrBuf256
>LDYAI TmpBuffer256 >LDYAI UsrBuf256
bra Cmd.Exec.CD.Change bra Cmd.Exec.CD.Change
.9 lda #SYSMGR.ERRSYN .9 lda #SYSMGR.ERRSYN
@ -233,17 +233,17 @@ Cmd.Exec.CD1 lda ARGS+1
rts rts
.3 >PUSHW L.ARGS Append ARG to buffer .3 >PUSHW L.ARGS Append ARG to buffer
>PUSHWI TmpBuffer256 >PUSHWI UsrBuf256
>SYSCALL SYS.PStrCat >SYSCALL SYS.PStrCat
ldx TmpBuffer256 ldx UsrBuf256
lda #'/' Ending with '/'? lda #'/' Ending with '/'?
cmp TmpBuffer256,x cmp UsrBuf256,x
beq .4 beq .4
sta TmpBuffer256+1,x sta UsrBuf256+1,x
inc TmpBuffer256 inc UsrBuf256
.4 >LDYAI TmpBuffer256 .4 >LDYAI UsrBuf256
Cmd.Exec.CD.Change Cmd.Exec.CD.Change
>STYA ZPPtr1 >STYA ZPPtr1
@ -368,12 +368,12 @@ Cmd.Exec.SETVAR tax
Cmd.Exec.DATE >LDYA L.TIME Cmd.Exec.DATE >LDYA L.TIME
>SYSCALL SYS.TimeYA >SYSCALL SYS.TimeYA
>PUSHWI TmpBuffer256 >PUSHWI UsrBuf256
>PUSHW L.FMT.DATE >PUSHW L.FMT.DATE
>PUSHW L.TIME >PUSHW L.TIME
>SYSCALL SYS.StrFTime >SYSCALL SYS.StrFTime
>LDYAI TmpBuffer256 >LDYAI UsrBuf256
>SYSCALL SYS.PStrOutYA >SYSCALL SYS.PStrOutYA
bcs .9 bcs .9
@ -384,13 +384,13 @@ Cmd.Exec.DATE >LDYA L.TIME
Cmd.Exec.TIME >LDYA L.TIME Cmd.Exec.TIME >LDYA L.TIME
>SYSCALL SYS.TimeYA >SYSCALL SYS.TimeYA
>PUSHWI TmpBuffer256 >PUSHWI UsrBuf256
>PUSHW L.FMT.TIME >PUSHW L.FMT.TIME
>PUSHW L.TIME >PUSHW L.TIME
>SYSCALL SYS.StrFTime >SYSCALL SYS.StrFTime
>LDYAI TmpBuffer256 >LDYAI UsrBuf256
>SYSCALL SYS.PStrOutYA >SYSCALL SYS.PStrOutYA
bcs .9 bcs .9

View File

@ -88,7 +88,7 @@ HIS.Add ldy #hCmdHistory
bpl .4 bpl .4
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
HIK.GetPrev ldy #hCmdHistory HIS.GetPrev ldy #hCmdHistory
lda (pData),y lda (pData),y
beq HISTORY.RTS beq HISTORY.RTS
@ -121,10 +121,10 @@ HIK.GetPrev ldy #hCmdHistory
.2 txa .2 txa
ldy #CmdHistory.IDX set new index ldy #CmdHistory.IDX set new index
sta (pData),y sta (pData),y
bra HIK.SetBuf bra HIS.SetBuf
History.RTS rts History.RTS rts
*-------------------------------------- *--------------------------------------
HIK.GetNext ldy #hCmdHistory HIS.GetNext ldy #hCmdHistory
lda (pData),y lda (pData),y
beq HISTORY.RTS beq HISTORY.RTS
@ -153,10 +153,10 @@ HIK.GetNext ldy #hCmdHistory
ldy #CmdHistory.END ldy #CmdHistory.END
cmp (pData),y cmp (pData),y
bne HIK.SetBuf bne HIS.SetBuf
jmp CmdBuffer.CLR end of history, just blank buffer jmp CmdBuffer.CLR end of history, just blank buffer
*-------------------------------------- *--------------------------------------
HIK.SetBuf jsr CmdBuffer.CLR HIS.SetBuf jsr CmdBuffer.CLR
ldy #CmdHistory.IDX ldy #CmdHistory.IDX
lda (pData),y lda (pData),y

View File

@ -28,7 +28,7 @@ TXT.OpenFileYA >SYSCALL SYS.MLIOpenYA
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
TXT.ReadFile >PUSHWI 127 TXT.ReadFile >PUSHWI 127
>PUSHWI TmpBuffer256+1 >PUSHWI UsrBuf256+1
ldy #hInputFile ldy #hInputFile
lda (pData),y lda (pData),y
>PUSHA >PUSHA
@ -38,7 +38,7 @@ TXT.ReadFile >PUSHWI 127
tya tya
beq .10 beq .10
lda TmpBuffer256,y Y,A=Bytes read lda UsrBuf256,y Y,A=Bytes read
cmp #$0D cmp #$0D
bne .10 bne .10
@ -48,7 +48,7 @@ TXT.ReadFile >PUSHWI 127
sta (pData) sta (pData)
beq .2 beq .2
.1 lda TmpBuffer256,y .1 lda UsrBuf256,y
sta (pData),y sta (pData),y
dey dey
bne .1 bne .1

View File

@ -410,12 +410,15 @@ K.READDIRA.ADD. lda #1
jsr K.READDIRA.ClrStat jsr K.READDIRA.ClrStat
lda #$0F
sta KrnBuf256+S.STAT.TYPE
ldy #$25 total_blocks ldy #$25 total_blocks
lda (ZPQuickPtr3),y lda (ZPQuickPtr3),y
sta KrnBuffer256+S.STAT.BLOCKS sta KrnBuf256+S.STAT.BLOCKS
iny iny
lda (ZPQuickPtr3),y lda (ZPQuickPtr3),y
sta KrnBuffer256+S.STAT.BLOCKS+1 sta KrnBuf256+S.STAT.BLOCKS+1
bra K.READDIRA.ADDSTAT bra K.READDIRA.ADDSTAT
*-------------------------------------- *--------------------------------------
@ -428,12 +431,18 @@ K.READDIRA.ADD..
jsr K.READDIRA.ClrStat jsr K.READDIRA.ClrStat
lda #$0F
sta KrnBuf256+S.STAT.TYPE
bra K.READDIRA.ADDSTAT bra K.READDIRA.ADDSTAT
*-------------------------------------- *--------------------------------------
K.READDIRA.ADDD jsr K.READDIRA.AddFNToBuf K.READDIRA.ADDD jsr K.READDIRA.AddFNToBuf
jsr K.READDIRA.ClrStat jsr K.READDIRA.ClrStat
lda #$0F
sta KrnBuf256+S.STAT.TYPE
bra K.READDIRA.ADDSTAT bra K.READDIRA.ADDSTAT
*-------------------------------------- *--------------------------------------
K.READDIRA.ADDF jsr K.READDIRA.AddFNToBuf K.READDIRA.ADDF jsr K.READDIRA.AddFNToBuf
@ -442,20 +451,20 @@ K.READDIRA.ADDF jsr K.READDIRA.AddFNToBuf
ldy #$10 type ldy #$10 type
lda (ZPQuickPtr3),y lda (ZPQuickPtr3),y
sta KrnBuffer256+S.STAT.TYPE sta KrnBuf256+S.STAT.TYPE
ldy #$1F auxtype ldy #$1F auxtype
lda (ZPQuickPtr3),y lda (ZPQuickPtr3),y
sta KrnBuffer256+S.STAT.AUXTYPE sta KrnBuf256+S.STAT.AUXTYPE
iny iny
lda (ZPQuickPtr3),y lda (ZPQuickPtr3),y
sta KrnBuffer256+S.STAT.AUXTYPE+1 sta KrnBuf256+S.STAT.AUXTYPE+1
*-------------------------------------- *--------------------------------------
K.READDIRA.AddStat K.READDIRA.AddStat
ldy #S.STAT-1 ldy #S.STAT-1
.1 lda KrnBuffer256,y .1 lda KrnBuf256,y
sta (ZPQuickPtr4),y sta (ZPQuickPtr4),y
dey dey
bpl .1 bpl .1
@ -471,7 +480,7 @@ K.READDIRA.AddStat
K.READDIRA.ClrStat K.READDIRA.ClrStat
ldx #S.STAT-1 ldx #S.STAT-1
.1 stz KrnBuffer256,x .1 stz KrnBuf256,x
dey dey
bpl .1 bpl .1
rts rts

View File

@ -9,11 +9,11 @@ K.ExpandPStrYA.NEW
>STYA ZPQuickPtr3 >STYA ZPQuickPtr3
lda (ZPQuickPtr3) lda (ZPQuickPtr3)
sta KrnBuffer256 sta KrnBuf256
tay tay
.1 lda (ZPQuickPtr3),y .1 lda (ZPQuickPtr3),y
sta KrnBuffer256,y sta KrnBuf256,y
dey dey
bne .1 bne .1
@ -22,11 +22,11 @@ K.ExpandPStrYA.NEW
.2 stz K.ExpandPStr.Start .2 stz K.ExpandPStr.Start
.3 tya .3 tya
cmp KrnBuffer256 End of PSTR? cmp KrnBuf256 End of PSTR?
beq .80 beq .80
iny iny
lda KrnBuffer256,y lda KrnBuf256,y
.80 .80
@ -42,7 +42,7 @@ K.ExpandPStrYA.NEW
K.ExpandPStrYA K.ExpandPStrYA
>STYA ZPQuickPtr3 >STYA ZPQuickPtr3
stz KrnBuffer256 init Expanded String len=0 stz KrnBuf256 init Expanded String len=0
ldy #0 ldy #0
@ -61,9 +61,9 @@ K.ExpandPStrYA
cmp #'$' no, found one ? cmp #'$' no, found one ?
beq .2 beq .2
inc KrnBuffer256 no, copy char inc KrnBuf256 no, copy char
ldx KrnBuffer256 ldx KrnBuf256
sta KrnBuffer256,x sta KrnBuf256,x
bra .1 bra .1
.2 sty K.ExpandPStr.Start save var start .2 sty K.ExpandPStr.Start save var start
@ -95,7 +95,7 @@ K.ExpandPStrYA
jsr K.ExpandPStr.AV yes, expand and add to STR jsr K.ExpandPStr.AV yes, expand and add to STR
.7 >LDYAI KrnBuffer256 .7 >LDYAI KrnBuf256
jsr K.NewPStrYA jsr K.NewPStrYA
rts rts
*-------------------------------------- *--------------------------------------
@ -103,12 +103,12 @@ K.ExpandPStr.AV lda K.ExpandPStr.End
sec sec
sbc K.ExpandPStr.Start compute len of VAR End-Start+1 sbc K.ExpandPStr.Start compute len of VAR End-Start+1
ldx KrnBuffer256 ldx KrnBuf256
inx inx
sta KrnBuffer256,x sta KrnBuf256,x
stx ZPQuickPtr2 stx ZPQuickPtr2
lda /KrnBuffer256 lda /KrnBuf256
sta ZPQuickPtr2+1 sta ZPQuickPtr2+1
ldy K.ExpandPStr.Start ldy K.ExpandPStr.Start
@ -116,7 +116,7 @@ K.ExpandPStr.AV lda K.ExpandPStr.End
.1 iny .1 iny
inx inx
lda (ZPQuickPtr3),y lda (ZPQuickPtr3),y
sta KrnBuffer256,x sta KrnBuf256,x
cpy K.ExpandPStr.End cpy K.ExpandPStr.End
bne .1 bne .1
@ -131,17 +131,17 @@ K.ExpandPStr.AV lda K.ExpandPStr.End
jsr S.NextEnvPtr1 Skip NAME jsr S.NextEnvPtr1 Skip NAME
.11 ldy #0 .11 ldy #0
ldx KrnBuffer256 ldx KrnBuf256
.2 iny .2 iny
lda (ZPQuickPtr1),y lda (ZPQuickPtr1),y
inx inx
sta KrnBuffer256,x sta KrnBuf256,x
tya tya
cmp (ZPQuickPtr1) last char? cmp (ZPQuickPtr1) last char?
bne .2 bne .2
stx KrnBuffer256 stx KrnBuf256
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
@ -171,48 +171,48 @@ K.ExpandPStr.End .BS 1
K.PutEnvYA >STYA ZPQuickPtr2 NAME=VALUE K.PutEnvYA >STYA ZPQuickPtr2 NAME=VALUE
lda (ZPQuickPtr2) lda (ZPQuickPtr2)
beq .9 beq .9
sta KrnBuffer256 sta KrnBuf256
tay tay
.1 lda (ZPQuickPtr2),y .1 lda (ZPQuickPtr2),y
sta KrnBuffer256,y sta KrnBuf256,y
dey dey
bne .1 bne .1
ldy #0 ldy #0
.2 iny .2 iny
cpy KrnBuffer256 last char ? cpy KrnBuf256 last char ?
beq .9 no "=" found beq .9 no "=" found
lda KrnBuffer256,y lda KrnBuf256,y
cmp #'=' cmp #'='
bne .2 bne .2
cpy #1 String like "=value" ? cpy #1 String like "=value" ?
beq .9 beq .9
cpy KrnBuffer256 last char ? cpy KrnBuf256 last char ?
beq .9 we have "VAR=" beq .9 we have "VAR="
lda KrnBuffer256 save actual string len lda KrnBuf256 save actual string len
sty KrnBuffer256 set length of VAR string sty KrnBuf256 set length of VAR string
dec KrnBuffer256 ...without "=" dec KrnBuf256 ...without "="
.3 clc Substract VAR len+1 from whole len to get .3 clc Substract VAR len+1 from whole len to get
sbc KrnBuffer256 VALUE len sbc KrnBuf256 VALUE len
sta KrnBuffer256,y save it at "=" POS sta KrnBuf256,y save it at "=" POS
tya tya
clc clc
adc #KrnBuffer256 adc #KrnBuf256
sta ZPQuickPtr3 sta ZPQuickPtr3
lda /KrnBuffer256 lda /KrnBuf256
sta ZPQuickPtr3+1 sta ZPQuickPtr3+1
>LDYAI KrnBuffer256 >LDYAI KrnBuf256
>STYA ZPQuickPtr2 >STYA ZPQuickPtr2
bra K.SetEnvPtr2Ptr3 bra K.SetEnvPtr2Ptr3

View File

@ -47,7 +47,7 @@ K.FileSearch >PULLW ZPQuickPtr4 ZPQuickPtr1 trashed by ExpandPStrYA
stz K.FileSearch.Index stz K.FileSearch.Index
.1 stz KrnBuffer256 reset String .1 stz KrnBuf256 reset String
ldx #0 ldx #0
ldy K.FileSearch.Index ldy K.FileSearch.Index
@ -60,7 +60,7 @@ K.FileSearch >PULLW ZPQuickPtr4 ZPQuickPtr1 trashed by ExpandPStrYA
cmp #';' cmp #';'
beq .3 beq .3
inx inx
sta KrnBuffer256,x sta KrnBuf256,x
bra .2 bra .2
.3 txa .3 txa
@ -73,20 +73,20 @@ K.FileSearch >PULLW ZPQuickPtr4 ZPQuickPtr1 trashed by ExpandPStrYA
.4 iny .4 iny
lda (ZPQuickPtr4),y Append Fiename... lda (ZPQuickPtr4),y Append Fiename...
inx inx
sta KrnBuffer256,x sta KrnBuf256,x
tya tya
cmp (ZPQuickPtr4) cmp (ZPQuickPtr4)
bne .4 bne .4
stx KrnBuffer256 set string length stx KrnBuf256 set string length
>LDYAI KrnBuffer256 >LDYAI KrnBuf256
jsr K.MLIGetFileInfoYA jsr K.MLIGetFileInfoYA
bcs .1 Failed...retry next path... bcs .1 Failed...retry next path...
lda K.FileSearch.hSrch Discard Expanded hSrch list lda K.FileSearch.hSrch Discard Expanded hSrch list
jsr K.FreeMemA jsr K.FreeMemA
>LDYAI KrnBuffer256 >LDYAI KrnBuf256
jmp K.NewPStrYA jmp K.NewPStrYA
.98 lda K.FileSearch.hSrch Discard Expanded hSrch list .98 lda K.FileSearch.hSrch Discard Expanded hSrch list
@ -110,7 +110,7 @@ K.GetFullPathYA >STYA ZPQuickPtr3 Ptr1 & 2 used by StrCpy
lda (ZPQuickPtr3) lda (ZPQuickPtr3)
beq .9 beq .9
stz KrnBuffer256 stz KrnBuf256
ldy #1 ldy #1
lda (ZPQuickPtr3),y lda (ZPQuickPtr3),y
@ -121,14 +121,14 @@ K.GetFullPathYA >STYA ZPQuickPtr3 Ptr1 & 2 used by StrCpy
lda (pPs),y lda (pPs),y
jsr K.GetMemPtrA jsr K.GetMemPtrA
>PUSHYA >PUSHYA
>PUSHWI KrnBuffer256 >PUSHWI KrnBuf256
jsr K.PStrCpy jsr K.PStrCpy
.1 >PUSHW ZPQuickPtr3 .1 >PUSHW ZPQuickPtr3
>PUSHWI KrnBuffer256 >PUSHWI KrnBuf256
jsr K.PStrCat jsr K.PStrCat
>LDYAI KrnBuffer256 >LDYAI KrnBuf256
jmp K.NewPStrYA jmp K.NewPStrYA
.9 sec .9 sec
rts rts

View File

@ -444,11 +444,12 @@ K.TskMgrInit stz TSKMGR.LASTID
ldy #S.PS.hENV ldy #S.PS.hENV
sta (pPs),y sta (pPs),y
>LDYAI TmpBuffer256 >LDYAI UsrBuf256
>SYSCALL SYS.MLIGetPrefixYA >STYA MLICALL.PARAMS+1
>MLICALL MLIGETPREFIX
bcs .9 bcs .9
>LDYAI TmpBuffer256 >LDYAI UsrBuf256
>SYSCALL SYS.NewPStrYA >SYSCALL SYS.NewPStrYA
bcs .9 bcs .9
@ -456,7 +457,7 @@ K.TskMgrInit stz TSKMGR.LASTID
ldy #S.PS.hPREFIX ldy #S.PS.hPREFIX
sta (pPs),y sta (pPs),y
>PUSHWI TmpBuffer256 push ENV value >PUSHWI UsrBuf256 push ENV value
>PUSHWI I.ENV.A2osX push ENV name >PUSHWI I.ENV.A2osX push ENV name
>SYSCALL SYS.SetEnv >SYSCALL SYS.SetEnv
bcs .9 bcs .9

View File

@ -49,15 +49,15 @@ KERNEL.SYSCALL .DA K.GetMem $00
.DA 0 .DA 0
.DA 0 .DA 0
.DA 0 .DA 0
.DA K.MLISetFileInfo .DA 0
.DA 0 .DA 0
*-------------------------------------- *--------------------------------------
.DA K.MLIGetFileInfoYA $50 .DA K.MLIGetFileInfoYA $50
.DA K.MLIOnline
.DA 0 .DA 0
.DA 0 .DA 0
.DA 0 .DA 0
.DA K.MLIGetPrefixYA .DA 0
.DA 0
.DA 0 .DA 0
.DA K.MLIOpenYA .DA K.MLIOpenYA
*-------------------------------------- *--------------------------------------
@ -70,7 +70,7 @@ KERNEL.SYSCALL .DA K.GetMem $00
.DA 0 .DA 0
.DA 0 .DA 0
*-------------------------------------- *--------------------------------------
.DA K.MLIGetEOFA $70 .DA 0 $70
.DA 0 .DA 0
.DA 0 .DA 0
.DA 0 .DA 0

View File

@ -16,19 +16,6 @@ K.MLICreateFile >PULLW MLICALL.PARAMS+1
>MLICALL MLICREATE >MLICALL MLICREATE
rts rts
*-------------------------------------- *--------------------------------------
* K.MLISetFileInfo
*--------------------------------------
K.MLISetFileInfo
>PULLW ZPQuickPtr1
>PULLW MLICALL.PARAMS+1
ldy #$E
.1 lda (ZPQuickPtr1),y
sta MLICALL.PARAMS+3,y
dey
bpl .1
>MLICALL MLISETFILEINFO
rts
*--------------------------------------
* K.MLIGetFileInfoYA * K.MLIGetFileInfoYA
* in : * in :
* Y,A = FileName * Y,A = FileName
@ -42,21 +29,6 @@ K.MLIGetFileInfoYA
>LDYAI MLICALL.PARAMS+3 >LDYAI MLICALL.PARAMS+3
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
* K.MLIOnline
* in :
* PULLB = Device
* PULLW = Dest PTR
*--------------------------------------
K.MLIOnline >PULLB MLICALL.PARAMS+1
>PULLW MLICALL.PARAMS+2
>MLICALL MLIONLINE
rts
*--------------------------------------
K.MLIGetPrefixYA
>STYA MLICALL.PARAMS+1
>MLICALL MLIGETPREFIX
rts
*--------------------------------------
* K.MLIOpenYA * K.MLIOpenYA
* in : * in :
* YA = FileName * YA = FileName
@ -139,20 +111,6 @@ K.MLICloseA sta MLICALL.PARAMS+1
>MLICALL MLICLOSE >MLICALL MLICLOSE
rts rts
*-------------------------------------- *--------------------------------------
* K.MLIGetEOF
* in :
* A = ref_num
* out :
* Y,A,X = EOF
*--------------------------------------
K.MLIGetEOFA sta MLICALL.PARAMS+1
>MLICALL MLIGETEOF
bcs .9
>LDYA MLICALL.PARAMS+2
ldx MLICALL.PARAMS+4
clc
.9 rts
*--------------------------------------
MAN MAN
SAVE SYS/KERNEL.S.MLI SAVE SYS/KERNEL.S.MLI
LOAD SYS/KERNEL.S LOAD SYS/KERNEL.S