mirror of
https://github.com/A2osX/A2osX.git
synced 2024-07-06 12:29:02 +00:00
Kernel 0.93
This commit is contained in:
parent
638e36f3a0
commit
b232facc43
Binary file not shown.
@ -312,7 +312,7 @@ CS.RUN ldy #S.PS.hStdIn
|
|||||||
|
|
||||||
jsr MAC.ReadLine
|
jsr MAC.ReadLine
|
||||||
bcc .2
|
bcc .2
|
||||||
cmp #E.NODATA
|
cmp #E.EMPTYKEY
|
||||||
bne .9
|
bne .9
|
||||||
>DEC.G MAC.Depth
|
>DEC.G MAC.Depth
|
||||||
|
|
||||||
|
@ -19,6 +19,16 @@ PG.SIZE .EQ 23
|
|||||||
ZS.START
|
ZS.START
|
||||||
ZPPTR1 .BS 2
|
ZPPTR1 .BS 2
|
||||||
ZPBufPtr .BS 2
|
ZPBufPtr .BS 2
|
||||||
|
ArgCount .BS 1
|
||||||
|
hFile .BS 1
|
||||||
|
LineCount .BS 1
|
||||||
|
LineNum .BS 2
|
||||||
|
bHelp .BS 1
|
||||||
|
bLineNum .BS 1
|
||||||
|
bPage .BS 1
|
||||||
|
bEscCodes .BS 1
|
||||||
|
ArgIndex .BS 1
|
||||||
|
hBuf .BS 1
|
||||||
ZS.END
|
ZS.END
|
||||||
.ED
|
.ED
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -32,7 +42,7 @@ CS.START cld
|
|||||||
.DA #0
|
.DA #0
|
||||||
.DA CS.END-CS.START Code Size (without Constants)
|
.DA CS.END-CS.START Code Size (without Constants)
|
||||||
.DA DS.END-DS.START Data SegmentSize
|
.DA DS.END-DS.START Data SegmentSize
|
||||||
.DA #16 Stack Size
|
.DA #64 Stack Size
|
||||||
.DA #ZS.END-ZS.START Zero Page Size
|
.DA #ZS.END-ZS.START Zero Page Size
|
||||||
.DA 0
|
.DA 0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -54,7 +64,8 @@ CS.INIT clc
|
|||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN
|
CS.RUN
|
||||||
.1 >INC.G ArgCount
|
.1 inc ArgCount
|
||||||
|
lda ArgCount
|
||||||
>SYSCALL ArgV
|
>SYSCALL ArgV
|
||||||
bcs .7
|
bcs .7
|
||||||
|
|
||||||
@ -86,7 +97,7 @@ CS.RUN
|
|||||||
sta (pData),y
|
sta (pData),y
|
||||||
bra .1
|
bra .1
|
||||||
|
|
||||||
.4 >LDA.G hFile
|
.4 lda hFile
|
||||||
bne .99
|
bne .99
|
||||||
|
|
||||||
>LDYA ZPPtr1
|
>LDYA ZPPtr1
|
||||||
@ -95,13 +106,14 @@ CS.RUN
|
|||||||
|
|
||||||
bra .1 scan for any other args
|
bra .1 scan for any other args
|
||||||
|
|
||||||
.7 >LDA.G bHelp
|
.7 lda bHelp
|
||||||
beq .8
|
beq .8
|
||||||
|
|
||||||
.71 jsr .99
|
.71 jsr .99
|
||||||
lda #0
|
lda #0
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.8 >LDA.G hFile
|
.8 lda hFile
|
||||||
bne .80
|
bne .80
|
||||||
|
|
||||||
ldy #S.PS.hStdIn
|
ldy #S.PS.hStdIn
|
||||||
@ -120,8 +132,7 @@ CS.RUN
|
|||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
>STYA ZPBufPtr
|
>STYA ZPBufPtr
|
||||||
txa
|
stx hBuf
|
||||||
>STA.G hBuf
|
|
||||||
|
|
||||||
>PUSHBI 0
|
>PUSHBI 0
|
||||||
>LDYA L.MSG.Init
|
>LDYA L.MSG.Init
|
||||||
@ -130,11 +141,13 @@ CS.RUN
|
|||||||
CS.RUN.LOOP jsr CS.RUN.GETLINE
|
CS.RUN.LOOP jsr CS.RUN.GETLINE
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
.1 >INCW.G LineNum
|
.1 inc LineNum
|
||||||
|
bne .11
|
||||||
|
inc LineNum+1
|
||||||
|
|
||||||
>LDA.G LineCount
|
.11 lda LineCount
|
||||||
bne .2
|
bne .2
|
||||||
>LDA.G bPage
|
lda bPage
|
||||||
beq .2
|
beq .2
|
||||||
|
|
||||||
lda #C.FF
|
lda #C.FF
|
||||||
@ -142,11 +155,11 @@ CS.RUN.LOOP jsr CS.RUN.GETLINE
|
|||||||
|
|
||||||
.2 jsr CS.RUN.PRINT
|
.2 jsr CS.RUN.PRINT
|
||||||
|
|
||||||
>INC.G LineCount
|
inc LineCount
|
||||||
|
lda LineCount
|
||||||
cmp #PG.SIZE
|
cmp #PG.SIZE
|
||||||
bne CS.RUN.LOOP
|
bne CS.RUN.LOOP
|
||||||
lda #0
|
stz LineCount
|
||||||
sta (pData),y
|
|
||||||
|
|
||||||
jsr CS.RUN.PAUSE
|
jsr CS.RUN.PAUSE
|
||||||
bcc CS.RUN.LOOP
|
bcc CS.RUN.LOOP
|
||||||
@ -167,7 +180,7 @@ CS.RUN.OPEN pha
|
|||||||
pla
|
pla
|
||||||
>SYSCALL FOpen
|
>SYSCALL FOpen
|
||||||
bcs .9
|
bcs .9
|
||||||
>STA.G hFile
|
sta hFile
|
||||||
|
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -203,9 +216,11 @@ CS.RUN.PAUSE >PUSHBI 0
|
|||||||
|
|
||||||
bra .90
|
bra .90
|
||||||
|
|
||||||
.5 >INCW.G LineNum
|
.5 inc LineNum
|
||||||
|
bne .6
|
||||||
jsr CS.RUN.PRINT
|
inc LineNum+1
|
||||||
|
|
||||||
|
.6 jsr CS.RUN.PRINT
|
||||||
|
|
||||||
bra CS.RUN.PAUSE
|
bra CS.RUN.PAUSE
|
||||||
|
|
||||||
@ -222,7 +237,7 @@ CS.RUN.ERASE >PUSHBI 0
|
|||||||
>SYSCALL fprintf
|
>SYSCALL fprintf
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN.GETC >LDA.G hFILE
|
CS.RUN.GETC lda hFILE
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
ldy #S.PS.hStdErr
|
ldy #S.PS.hStdErr
|
||||||
@ -235,7 +250,7 @@ CS.RUN.GETC >LDA.G hFILE
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN.GETLINE >PUSHWI 256
|
CS.RUN.GETLINE >PUSHWI 256
|
||||||
>PUSHW ZPBufPtr
|
>PUSHW ZPBufPtr
|
||||||
>LDA.G hFile
|
lda hFile
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
ldy #S.PS.hStdIn
|
ldy #S.PS.hStdIn
|
||||||
@ -244,16 +259,16 @@ CS.RUN.GETLINE >PUSHWI 256
|
|||||||
.1 >SYSCALL fgets
|
.1 >SYSCALL fgets
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN.PRINT >LDA.G bLineNum
|
CS.RUN.PRINT lda bLineNum
|
||||||
bpl .1
|
bpl .1
|
||||||
|
|
||||||
>PUSHW.G LineNum
|
>PUSHW LineNum
|
||||||
>PUSHBI 2
|
>PUSHBI 2
|
||||||
>LDYA L.MSG.NUMLINE
|
>LDYA L.MSG.NUMLINE
|
||||||
>SYSCALL printf
|
>SYSCALL printf
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
.1 >LDA.G bEscCodes
|
.1 lda bEscCodes
|
||||||
bmi .2
|
bmi .2
|
||||||
|
|
||||||
>LDYA ZPBufPtr
|
>LDYA ZPBufPtr
|
||||||
@ -270,12 +285,12 @@ CS.RUN.PRINT >LDA.G bLineNum
|
|||||||
>SYSCALL printf
|
>SYSCALL printf
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.QUIT >LDA.G hBuf
|
CS.QUIT lda hBuf
|
||||||
beq .1
|
beq .1
|
||||||
|
|
||||||
>SYSCALL FreeMem
|
>SYSCALL FreeMem
|
||||||
|
|
||||||
.1 >LDA.G hFILE
|
.1 lda hFILE
|
||||||
beq .2
|
beq .2
|
||||||
|
|
||||||
>SYSCALL FClose
|
>SYSCALL FClose
|
||||||
@ -306,16 +321,6 @@ MSG.PauseErase .AZ "\r\e[2K"
|
|||||||
.DUMMY
|
.DUMMY
|
||||||
.OR 0
|
.OR 0
|
||||||
DS.START
|
DS.START
|
||||||
ArgCount .BS 1
|
|
||||||
hFile .BS 1
|
|
||||||
LineCount .BS 1
|
|
||||||
LineNum .BS 2
|
|
||||||
bHelp .BS 1
|
|
||||||
bLineNum .BS 1
|
|
||||||
bPage .BS 1
|
|
||||||
bEscCodes .BS 1
|
|
||||||
ArgIndex .BS 1
|
|
||||||
hBuf .BS 1
|
|
||||||
DS.END
|
DS.END
|
||||||
.ED
|
.ED
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -59,7 +59,7 @@ IO.Reset.In >LDA.G IO.hIn
|
|||||||
.8 clc
|
.8 clc
|
||||||
IO.Reset.In.RTS rts
|
IO.Reset.In.RTS rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
IO.Pipe.Out >LDYAI 256
|
IO.Pipe.Out >LDYAI 512
|
||||||
>SYSCALL pipe
|
>SYSCALL pipe
|
||||||
bcs IO.Reset.In.RTS
|
bcs IO.Reset.In.RTS
|
||||||
>STA.G IO.hPipe
|
>STA.G IO.hPipe
|
||||||
|
@ -109,6 +109,7 @@ CS.START cld
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
L.MSG.GREETINGS .DA MSG.GREETINGS
|
L.MSG.GREETINGS .DA MSG.GREETINGS
|
||||||
L.MSG.PROMPT .DA MSG.PROMPT
|
L.MSG.PROMPT .DA MSG.PROMPT
|
||||||
|
L.MSG.PROMPTCRLF .DA MSG.PROMPTCRLF
|
||||||
L.MSG.TRACE .DA MSG.TRACE
|
L.MSG.TRACE .DA MSG.TRACE
|
||||||
L.MSG.ECHOCRLF .DA MSG.ECHOCRLF
|
L.MSG.ECHOCRLF .DA MSG.ECHOCRLF
|
||||||
L.MSG.BATCHERR .DA MSG.BATCHERR
|
L.MSG.BATCHERR .DA MSG.BATCHERR
|
||||||
@ -339,7 +340,7 @@ CS.RUN.INTERACTIVE
|
|||||||
bpl .1
|
bpl .1
|
||||||
|
|
||||||
>PUSHBI 0
|
>PUSHBI 0
|
||||||
>LDYA L.MSG.ECHOCRLF
|
>LDYA L.MSG.PROMPTCRLF
|
||||||
>SYSCALL printf
|
>SYSCALL printf
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
@ -581,7 +582,8 @@ ToUpperCase cmp #'a'
|
|||||||
CS.END
|
CS.END
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
MSG.GREETINGS .AZ "\r\nA2osX-SH %d.%d\r\n\r\n"
|
MSG.GREETINGS .AZ "\r\nA2osX-SH %d.%d\r\n\r\n"
|
||||||
MSG.PROMPT .AZ "\e[7h$ "
|
MSG.PROMPT .AZ "\e[7h$ " Enable Line Wrap
|
||||||
|
MSG.PROMPTCRLF .AZ "\e[7l\r\n" Disable Line Wrap
|
||||||
MSG.TRACE .AZ ">%s\r\n"
|
MSG.TRACE .AZ ">%s\r\n"
|
||||||
MSG.BATCHERR .AZ "^\r\nLine #%D:"
|
MSG.BATCHERR .AZ "^\r\nLine #%D:"
|
||||||
MSG.ERROR .AS "[$%h]:%S."
|
MSG.ERROR .AS "[$%h]:%S."
|
||||||
|
@ -334,7 +334,7 @@ READ php
|
|||||||
lda L91C96.2.IST,x
|
lda L91C96.2.IST,x
|
||||||
and #L91C96.2.IST.RCV
|
and #L91C96.2.IST.RCV
|
||||||
bne .1
|
bne .1
|
||||||
lda #MLI.E.EOF
|
lda #E.NODATA
|
||||||
|
|
||||||
.9 plp
|
.9 plp
|
||||||
sec
|
sec
|
||||||
@ -373,10 +373,10 @@ READ php
|
|||||||
|
|
||||||
ply
|
ply
|
||||||
|
|
||||||
>SYSCALL getmem
|
>SYSCALL2 getmem
|
||||||
bcs .9
|
bcs .9
|
||||||
>STYA ZPBufPtr
|
>STYA ZPBufPtr
|
||||||
stx .8+1
|
phx
|
||||||
|
|
||||||
phy
|
phy
|
||||||
ldy #S.IOCTL.BUFPTR+1
|
ldy #S.IOCTL.BUFPTR+1
|
||||||
@ -415,7 +415,7 @@ READ php
|
|||||||
.4 lda #L91C96.2.MMUCR.REMREL
|
.4 lda #L91C96.2.MMUCR.REMREL
|
||||||
sta L91C96.2.MMUCR,x
|
sta L91C96.2.MMUCR,x
|
||||||
|
|
||||||
.8 lda #$ff hMem
|
.8 pla hMem
|
||||||
|
|
||||||
plp
|
plp
|
||||||
clc
|
clc
|
||||||
@ -464,7 +464,7 @@ WRITE php
|
|||||||
dey
|
dey
|
||||||
bne .2
|
bne .2
|
||||||
|
|
||||||
lda #MLI.E.EOF
|
lda #E.NODATA
|
||||||
|
|
||||||
.9 plp
|
.9 plp
|
||||||
sec
|
sec
|
||||||
|
@ -374,7 +374,7 @@ READ php
|
|||||||
and /PP.RxEvent.RxOK+PP.RxEvent.IA+PP.RxEvent.Brdcast+PP.RxEvent.Runt
|
and /PP.RxEvent.RxOK+PP.RxEvent.IA+PP.RxEvent.Brdcast+PP.RxEvent.Runt
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
lda #MLI.E.EOF
|
lda #E.NODATA
|
||||||
|
|
||||||
.9 plp
|
.9 plp
|
||||||
sec
|
sec
|
||||||
@ -400,7 +400,7 @@ READ php
|
|||||||
|
|
||||||
pla
|
pla
|
||||||
|
|
||||||
>SYSCALL getmem
|
>SYSCALL2 getmem
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
>STYA ZPBufPtr
|
>STYA ZPBufPtr
|
||||||
@ -488,7 +488,7 @@ WRITE php
|
|||||||
dey
|
dey
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
.9 lda #MLI.E.EOF
|
.9 lda #E.NODATA
|
||||||
|
|
||||||
plp
|
plp
|
||||||
sec
|
sec
|
||||||
|
@ -387,7 +387,7 @@ READ php
|
|||||||
ora W5100.DR,x LO
|
ora W5100.DR,x LO
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
lda #MLI.E.EOF
|
lda #E.NODATA
|
||||||
|
|
||||||
.9 plp
|
.9 plp
|
||||||
sec
|
sec
|
||||||
@ -432,11 +432,11 @@ READ php
|
|||||||
sty RXTX.Size
|
sty RXTX.Size
|
||||||
.FIN
|
.FIN
|
||||||
|
|
||||||
>SYSCALL getmem
|
>SYSCALL2 getmem
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
>STYA ZPBufPtr
|
>STYA ZPBufPtr
|
||||||
stx .8+1
|
phx
|
||||||
|
|
||||||
phy
|
phy
|
||||||
ldy #S.IOCTL.BUFPTR+1
|
ldy #S.IOCTL.BUFPTR+1
|
||||||
@ -529,7 +529,7 @@ READ php
|
|||||||
lda #W5100.AR.S0.CR.RCVD
|
lda #W5100.AR.S0.CR.RCVD
|
||||||
sta W5100.DR,x
|
sta W5100.DR,x
|
||||||
|
|
||||||
.8 lda #$ff SELF MODIFIED hMem
|
pla hMem
|
||||||
|
|
||||||
plp
|
plp
|
||||||
clc
|
clc
|
||||||
@ -569,7 +569,7 @@ WRITE php
|
|||||||
sbc RXTX.Size+1
|
sbc RXTX.Size+1
|
||||||
bcs WRITE.1
|
bcs WRITE.1
|
||||||
|
|
||||||
lda #MLI.E.EOF
|
lda #E.NODATA
|
||||||
|
|
||||||
plp
|
plp
|
||||||
sec
|
sec
|
||||||
|
@ -6,7 +6,7 @@ K.ENV.SIZE .EQ 256
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
K.MEM.ALIGN .EQ 16
|
K.MEM.ALIGN .EQ 16
|
||||||
K.MEM.nALIGNm1 .EQ $F0
|
K.MEM.nALIGNm1 .EQ $F0
|
||||||
*K.MEM.ALIGN .EQ 64
|
*K.MEM.ALIGN .EQ 64
|
||||||
*K.MEM.nALIGNm1 .EQ $C0
|
*K.MEM.nALIGNm1 .EQ $C0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
K.IRQDEV.MAX .EQ 4
|
K.IRQDEV.MAX .EQ 4
|
||||||
@ -94,6 +94,8 @@ A2osX.SYSCALL2 .EQ $E200
|
|||||||
* Kernel ERROR CODES : $60->$7F
|
* Kernel ERROR CODES : $60->$7F
|
||||||
* Lib ERROR CODES : $80->$BF
|
* Lib ERROR CODES : $80->$BF
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
E.NODATA .EQ $FF No Data
|
||||||
|
*--------------------------------------
|
||||||
E.OOM .EQ $7F Out Of Memory Error
|
E.OOM .EQ $7F Out Of Memory Error
|
||||||
E.OOH .EQ $7E Out Of Handle Error
|
E.OOH .EQ $7E Out Of Handle Error
|
||||||
E.INVH .EQ $7D Invalid Handle
|
E.INVH .EQ $7D Invalid Handle
|
||||||
@ -110,7 +112,7 @@ E.INUM .EQ $73 Invalid Numerical
|
|||||||
|
|
||||||
E.NOKEY .EQ $6F Undefined Key
|
E.NOKEY .EQ $6F Undefined Key
|
||||||
E.DUPKEY .EQ $6E Duplicate Key
|
E.DUPKEY .EQ $6E Duplicate Key
|
||||||
E.NODATA .EQ $6D No Data
|
E.EMPTYKEY .EQ $6D No Data for this key
|
||||||
E.DATALEN .EQ $6C Data Length Mismatch
|
E.DATALEN .EQ $6C Data Length Mismatch
|
||||||
|
|
||||||
E.IPWDDB .EQ $68 Invalid PWD database
|
E.IPWDDB .EQ $68 Invalid PWD database
|
||||||
@ -129,6 +131,8 @@ C.VT .EQ 11
|
|||||||
C.FF .EQ 12
|
C.FF .EQ 12
|
||||||
C.CR .EQ 13
|
C.CR .EQ 13
|
||||||
C.FS .EQ 21
|
C.FS .EQ 21
|
||||||
|
C.S0 .EQ 24
|
||||||
|
C.S1 .EQ 25
|
||||||
C.ESC .EQ 27
|
C.ESC .EQ 27
|
||||||
C.SPACE .EQ 32
|
C.SPACE .EQ 32
|
||||||
C.COLON .EQ 58
|
C.COLON .EQ 58
|
||||||
|
@ -3,10 +3,12 @@ PREFIX
|
|||||||
AUTO 4,1
|
AUTO 4,1
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/+/jb-dev/sysroot/usr/include/arpa/telnet.h
|
* https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/+/jb-dev/sysroot/usr/include/arpa/telnet.h
|
||||||
|
* https://web.maths.unsw.edu.au/~lafaye/CCM/internet/telnet.htm
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
TCP.PORT.TELNET .EQ 23
|
TCP.PORT.TELNET .EQ 23
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
SE .EQ 240 $F0
|
SE .EQ 240 $F0
|
||||||
|
DM .EQ 242 $F2
|
||||||
SB .EQ 250 $FA
|
SB .EQ 250 $FA
|
||||||
SB.IS .EQ 0
|
SB.IS .EQ 0
|
||||||
SB.SEND .EQ 1
|
SB.SEND .EQ 1
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
NEW
|
NEW
|
||||||
PREFIX
|
AUTO 3,1
|
||||||
AUTO 4,1
|
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
.OP 65C02
|
.OP 65C02
|
||||||
.OR $2000
|
.OR $2000
|
||||||
|
@ -404,9 +404,8 @@ SKT.Read jsr SKT.PullhFDDataInPtrLen
|
|||||||
|
|
||||||
jsr TCP.OUT.SendOptA
|
jsr TCP.OUT.SendOptA
|
||||||
|
|
||||||
.8 lda #0
|
.8 lda #E.NODATA
|
||||||
tay eof=true, exit with CC,Y,A = 0
|
sec
|
||||||
clc
|
|
||||||
.99 rts
|
.99 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* In:
|
* In:
|
||||||
@ -552,9 +551,8 @@ SKT.Write jsr SKT.PullhFDDataInPtrLen
|
|||||||
|
|
||||||
bcs SKT.AddDataToSktOut
|
bcs SKT.AddDataToSktOut
|
||||||
|
|
||||||
lda #0 Not enough room in Q,no data transfered
|
lda #E.NODATA Not enough room in Q,no data transfered
|
||||||
tay exit with CC,Y,A = 0
|
sec
|
||||||
clc
|
|
||||||
.99 rts
|
.99 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* Src : ZPDataInPtr/ZPDataInLen
|
* Src : ZPDataInPtr/ZPDataInLen
|
||||||
|
@ -178,7 +178,7 @@ BIN.Load.1 >LDYA K.S.STAT+S.STAT.P.AUXTYPE
|
|||||||
>LDYA BIN.CmdLine
|
>LDYA BIN.CmdLine
|
||||||
|
|
||||||
ldx #SYS.LoadFile
|
ldx #SYS.LoadFile
|
||||||
jsr K.SYSCALL.GoB BANK1!!!
|
jsr K.SYSCALL2.BANK BANK1!!!
|
||||||
bcs BIN.Load.Cleanup.RTS Error Loading file
|
bcs BIN.Load.Cleanup.RTS Error Loading file
|
||||||
|
|
||||||
stx BIN.hMem save hMem
|
stx BIN.hMem save hMem
|
||||||
@ -220,7 +220,7 @@ BIN.Load.1 >LDYA K.S.STAT+S.STAT.P.AUXTYPE
|
|||||||
|
|
||||||
>LDYA BIN.CmdLine get back bin path
|
>LDYA BIN.CmdLine get back bin path
|
||||||
ldx #SYS.strdup make a copy of this string
|
ldx #SYS.strdup make a copy of this string
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
bcs .98
|
bcs .98
|
||||||
|
|
||||||
lda BIN.hMem Keep X=new string hMem
|
lda BIN.hMem Keep X=new string hMem
|
||||||
|
@ -529,7 +529,7 @@ CORE.PSFree sta .10+1 Save PS ID
|
|||||||
|
|
||||||
txa
|
txa
|
||||||
ldx #SYS.fclose
|
ldx #SYS.fclose
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
|
|
||||||
.10 lda #$ff Self Modified
|
.10 lda #$ff Self Modified
|
||||||
|
|
||||||
|
@ -156,6 +156,8 @@ S.DCB.TTY.MODE .EQ 2
|
|||||||
S.DCB.TTY.MODE.ESC .EQ 2
|
S.DCB.TTY.MODE.ESC .EQ 2
|
||||||
S.DCB.TTY.MODE.CSI .EQ 4
|
S.DCB.TTY.MODE.CSI .EQ 4
|
||||||
S.DCB.TTY.MODE.IAC .EQ 6
|
S.DCB.TTY.MODE.IAC .EQ 6
|
||||||
|
S.DCB.TTY.MODE.G0 .EQ 8
|
||||||
|
S.DCB.TTY.MODE.G1 .EQ 10
|
||||||
S.DCB.TTY.CH .EQ 3
|
S.DCB.TTY.CH .EQ 3
|
||||||
S.DCB.TTY.CV .EQ 4
|
S.DCB.TTY.CV .EQ 4
|
||||||
S.DCB.TTY.SCROLLTOP .EQ 5
|
S.DCB.TTY.SCROLLTOP .EQ 5
|
||||||
|
@ -579,8 +579,7 @@ K.ReadDir.ConvertTime
|
|||||||
lda ZPPtr3+1
|
lda ZPPtr3+1
|
||||||
adc #0
|
adc #0
|
||||||
ldx #SYS.PTime2Time BANK2
|
ldx #SYS.PTime2Time BANK2
|
||||||
jsr K.SYSCALL.GoB
|
jmp K.SYSCALL2.BANK
|
||||||
rts
|
|
||||||
*/-------------------------------------
|
*/-------------------------------------
|
||||||
* # CloseDir
|
* # CloseDir
|
||||||
* ## C
|
* ## C
|
||||||
|
@ -119,7 +119,7 @@ K.ExpandStr stz .88+1 Reset Intermediate string...
|
|||||||
|
|
||||||
>LDYAI K.Buf256
|
>LDYAI K.Buf256
|
||||||
ldx #SYS.StrDup
|
ldx #SYS.StrDup
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
stx .88+1 save this as temp string, in case of recurse
|
stx .88+1 save this as temp string, in case of recurse
|
||||||
@ -233,7 +233,7 @@ ENV.Search.YA >STYA .4+1
|
|||||||
.5 >PUSHWI K.S.STAT
|
.5 >PUSHWI K.S.STAT
|
||||||
>LDYAI K.Buf256
|
>LDYAI K.Buf256
|
||||||
ldx #SYS.stat
|
ldx #SYS.stat
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
bcs .1 Failed...retry next path...
|
bcs .1 Failed...retry next path...
|
||||||
|
|
||||||
lda K.S.STAT+S.STAT.P.TYPE
|
lda K.S.STAT+S.STAT.P.TYPE
|
||||||
|
@ -129,7 +129,7 @@ GP.SysCall dec IRQ.InKernel
|
|||||||
tay
|
tay
|
||||||
pla
|
pla
|
||||||
|
|
||||||
jsr K.SYSCALL.Go
|
jsr K.SYSCALL2
|
||||||
bcc .2 no error quit...
|
bcc .2 no error quit...
|
||||||
|
|
||||||
tax CS,A=0 ?
|
tax CS,A=0 ?
|
||||||
|
@ -312,7 +312,7 @@ IO.CLOSE.NOD ldx #2
|
|||||||
* sec
|
* sec
|
||||||
rts
|
rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # read (BLOCKING)
|
* # read
|
||||||
* ## C
|
* ## C
|
||||||
* `int read(hFD fd, void *buf, int count);`
|
* `int read(hFD fd, void *buf, int count);`
|
||||||
* ## ASM
|
* ## ASM
|
||||||
@ -342,7 +342,7 @@ IO.Read.I lda (pFD) #S.FD.T
|
|||||||
.DA IO.READ.SSOCK
|
.DA IO.READ.SSOCK
|
||||||
.DA IO.READ.PIPE
|
.DA IO.READ.PIPE
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # write (BLOCKING)
|
* # write
|
||||||
* ## C
|
* ## C
|
||||||
* `int write(hFD fd, const void *buf, int count);`
|
* `int write(hFD fd, const void *buf, int count);`
|
||||||
* ## ASM
|
* ## ASM
|
||||||
@ -389,40 +389,28 @@ IO.WRITE.REG ldx #MLIWRITE
|
|||||||
>LDYA K.MLI.PARAMS+6
|
>LDYA K.MLI.PARAMS+6
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* (pStack)+2 count
|
|
||||||
* (pStack)+0 buf
|
|
||||||
*--------------------------------------
|
|
||||||
IO.READ.CDEV ldx #IOCTL.READ
|
IO.READ.CDEV ldx #IOCTL.READ
|
||||||
.HS 2C BIT ABS
|
.HS 2C BIT ABS
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
IO.WRITE.CDEV ldx #IOCTL.WRITE
|
IO.WRITE.CDEV ldx #IOCTL.WRITE
|
||||||
|
|
||||||
ldy #3
|
>PULLW K.S.IOCTL+S.IOCTL.BUFPTR
|
||||||
|
>PULLW K.S.IOCTL+S.IOCTL.BYTECNT
|
||||||
.1 lda (pStack),y
|
|
||||||
sta K.S.IOCTL+S.IOCTL.BUFPTR,y
|
|
||||||
dey
|
|
||||||
bpl .1
|
|
||||||
|
|
||||||
jsr K.IOCTL.GetPDRV
|
jsr K.IOCTL.GetPDRV
|
||||||
|
|
||||||
>LDYAI K.S.IOCTL
|
>LDYAI K.S.IOCTL
|
||||||
|
|
||||||
jsr K.IOCTL.pDrvJmp
|
jsr K.IOCTL.pDrvJmp
|
||||||
bcc .8
|
bcs .9
|
||||||
tay CS, A=0 ?
|
>LDYA K.S.IOCTL+S.IOCTL.BYTECNT
|
||||||
bne .9 no, I/O error
|
|
||||||
|
|
||||||
rts BLOCKING I/O
|
.9 rts
|
||||||
|
|
||||||
.8 >LDYA K.S.IOCTL+S.IOCTL.BYTECNT
|
|
||||||
|
|
||||||
.9 >RET 4
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
IO.WRITE.SSOCK ldy #S.FD.SSOCK.WRITE
|
IO.WRITE.SSOCK ldy #S.FD.SSOCK.WRITE
|
||||||
.HS 2C BIT ABS
|
.HS 2C BIT ABS
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
IO.READ.SSOCK ldy #S.FD.SSOCK.READ
|
IO.READ.SSOCK ldy #S.FD.SSOCK.READ
|
||||||
|
|
||||||
lda (pFD),y
|
lda (pFD),y
|
||||||
tax Function Offset in LIB
|
tax Function Offset in LIB
|
||||||
|
|
||||||
@ -433,25 +421,7 @@ IO.READ.SSOCK ldy #S.FD.SSOCK.READ
|
|||||||
|
|
||||||
lda IO.hFD
|
lda IO.hFD
|
||||||
|
|
||||||
.1 jsr $FFFF SELF MODIFIED
|
.1 jmp $FFFF SELF MODIFIED
|
||||||
bcs .9 I/O error
|
|
||||||
|
|
||||||
phy
|
|
||||||
ply
|
|
||||||
bne .9
|
|
||||||
|
|
||||||
tax
|
|
||||||
bne .9
|
|
||||||
|
|
||||||
dec pStack no data transfered, CC, Y,A = 0
|
|
||||||
dec pStack
|
|
||||||
dec pStack
|
|
||||||
dec pStack keep buf/count on stack
|
|
||||||
sec BLOCKING I/O
|
|
||||||
.9 rts
|
|
||||||
*--------------------------------------
|
|
||||||
* (pStack)+2 count
|
|
||||||
* (pStack)+0 buf
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
IO.READ.PIPE ldy #S.FD.PIPE.Used+1
|
IO.READ.PIPE ldy #S.FD.PIPE.Used+1
|
||||||
|
|
||||||
@ -466,7 +436,7 @@ IO.READ.PIPE ldy #S.FD.PIPE.Used+1
|
|||||||
|
|
||||||
jmp IO.READ.PIPE.EOF Remote PS closed the Pipe
|
jmp IO.READ.PIPE.EOF Remote PS closed the Pipe
|
||||||
|
|
||||||
.11 jmp IO.READ.PIPE.BLK
|
.11 jmp IO.READ.PIPE.NODATA
|
||||||
|
|
||||||
.10 >PULLW .3+1 get buf
|
.10 >PULLW .3+1 get buf
|
||||||
|
|
||||||
@ -506,6 +476,7 @@ IO.READ.PIPE ldy #S.FD.PIPE.Used+1
|
|||||||
sty .2+1
|
sty .2+1
|
||||||
|
|
||||||
ldy #S.FD.PIPE.Tail+1
|
ldy #S.FD.PIPE.Tail+1
|
||||||
|
* clc
|
||||||
adc (pFD),y
|
adc (pFD),y
|
||||||
sta .2+2
|
sta .2+2
|
||||||
|
|
||||||
@ -591,13 +562,11 @@ IO.READ.PIPE ldy #S.FD.PIPE.Used+1
|
|||||||
|
|
||||||
IO.READ.PIPE.EOF
|
IO.READ.PIPE.EOF
|
||||||
lda #MLI.E.EOF
|
lda #MLI.E.EOF
|
||||||
|
.HS 2C BIT ABS
|
||||||
|
IO.READ.PIPE.NODATA
|
||||||
|
lda #E.NODATA
|
||||||
sec
|
sec
|
||||||
>RET 4
|
>RET 4
|
||||||
|
|
||||||
IO.READ.PIPE.BLK
|
|
||||||
lda #0 BLOCKING I/O
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* (pStack)+2 count
|
* (pStack)+2 count
|
||||||
* (pStack)+0 buf
|
* (pStack)+0 buf
|
||||||
@ -618,7 +587,7 @@ IO.WRITE.PIPE ldy #S.FD.PIPE.S
|
|||||||
ldy #3
|
ldy #3
|
||||||
sbc (pStack),y
|
sbc (pStack),y
|
||||||
|
|
||||||
bcc IO.READ.PIPE.BLK not enough room in PIPE
|
bcc IO.READ.PIPE.NODATA not enough room in PIPE
|
||||||
|
|
||||||
ldy #S.FD.PIPE.Free+1
|
ldy #S.FD.PIPE.Free+1
|
||||||
sta (pFD),y
|
sta (pFD),y
|
||||||
@ -627,7 +596,7 @@ IO.WRITE.PIPE ldy #S.FD.PIPE.S
|
|||||||
sta (pFD),y store new Free
|
sta (pFD),y store new Free
|
||||||
|
|
||||||
>PULLW .2+1 get buf
|
>PULLW .2+1 get buf
|
||||||
|
|
||||||
>PULLA get cnt lo
|
>PULLA get cnt lo
|
||||||
sta .80+1
|
sta .80+1
|
||||||
pha
|
pha
|
||||||
|
@ -417,10 +417,10 @@ K.SYSCALL.BANK .DA #RRAMWRAMBNK1 $00
|
|||||||
.DA 0
|
.DA 0
|
||||||
.DA 0
|
.DA 0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
K.SYSCALL.Go bit K.SYSCALL.BANK,x Get Target BNK
|
K.SYSCALL2 bit K.SYSCALL.BANK,x Get Target BNK
|
||||||
bpl K.SYSCALL.JMP 0, E000, no BNK change
|
bpl K.SYSCALL.JMP 0, E000, no BNK change
|
||||||
|
|
||||||
K.SYSCALL.GoB sta .7+1
|
K.SYSCALL2.BANK sta .7+1
|
||||||
lda $D000 #RRAMWRAMBNK1 or #RRAMWRAMBNK2
|
lda $D000 #RRAMWRAMBNK1 or #RRAMWRAMBNK2
|
||||||
cmp K.SYSCALL.BANK,x
|
cmp K.SYSCALL.BANK,x
|
||||||
beq .7
|
beq .7
|
||||||
|
@ -273,7 +273,7 @@ K.FreeMem.ERR phx
|
|||||||
>LDYAI K.FreeMem.MSG
|
>LDYAI K.FreeMem.MSG
|
||||||
|
|
||||||
.1 ldx #SYS.printf
|
.1 ldx #SYS.printf
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
plx
|
plx
|
||||||
|
|
||||||
sec
|
sec
|
||||||
@ -536,7 +536,7 @@ K.FreeStkObj ldx #SYS.FreeMem
|
|||||||
* X = hMem of Loaded Object in AUX mem
|
* X = hMem of Loaded Object in AUX mem
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.LoadStkObj ldx #SYS.LoadTxtFile To get ending \0
|
K.LoadStkObj ldx #SYS.LoadTxtFile To get ending \0
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
bcs .99
|
bcs .99
|
||||||
|
|
||||||
sty .81+1
|
sty .81+1
|
||||||
|
@ -144,7 +144,7 @@ PS.CreateChild ldx #0
|
|||||||
jsr K.GetMemPtr
|
jsr K.GetMemPtr
|
||||||
|
|
||||||
ldx #SYS.StrDup
|
ldx #SYS.StrDup
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
jsr PS.SetMemOwner Set Ownership
|
jsr PS.SetMemOwner Set Ownership
|
||||||
@ -230,7 +230,7 @@ PS.Load ldy #$ff
|
|||||||
>PUSHWI K.S.STAT
|
>PUSHWI K.S.STAT
|
||||||
>LDYA PS.ArgV found /, some path specified, no search
|
>LDYA PS.ArgV found /, some path specified, no search
|
||||||
ldx #SYS.stat
|
ldx #SYS.stat
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
bcc .6 REAL path in K.Buf256
|
bcc .6 REAL path in K.Buf256
|
||||||
|
|
||||||
.99 rts
|
.99 rts
|
||||||
@ -308,7 +308,7 @@ PS.Load.SCRIPT ldx #$ff
|
|||||||
.5 >PUSHWI K.S.STAT
|
.5 >PUSHWI K.S.STAT
|
||||||
>LDYAI K.Buf256
|
>LDYAI K.Buf256
|
||||||
ldx #SYS.stat
|
ldx #SYS.stat
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
bcs PS.Load.RTS
|
bcs PS.Load.RTS
|
||||||
|
|
||||||
lda K.S.STAT+S.STAT.P.TYPE
|
lda K.S.STAT+S.STAT.P.TYPE
|
||||||
@ -415,7 +415,7 @@ PS.LoadGetHeader
|
|||||||
>PUSHBI O.RDONLY
|
>PUSHBI O.RDONLY
|
||||||
>LDYAI K.IOBuf
|
>LDYAI K.IOBuf
|
||||||
ldx #SYS.fopen
|
ldx #SYS.fopen
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
bcs .9
|
bcs .9
|
||||||
sta .1+1
|
sta .1+1
|
||||||
|
|
||||||
@ -423,13 +423,13 @@ PS.LoadGetHeader
|
|||||||
>PUSHWI K.IOBuf+128
|
>PUSHWI K.IOBuf+128
|
||||||
.1 lda #$ff SELF MODIFIED
|
.1 lda #$ff SELF MODIFIED
|
||||||
ldx #SYS.fread
|
ldx #SYS.fread
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
|
|
||||||
php
|
php
|
||||||
pha
|
pha
|
||||||
lda .1+1
|
lda .1+1
|
||||||
ldx #SYS.fclose
|
ldx #SYS.fclose
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
pla
|
pla
|
||||||
plp
|
plp
|
||||||
.9 rts
|
.9 rts
|
||||||
|
@ -74,7 +74,7 @@ PWD.Store lda PWD.DBPtr
|
|||||||
>PUSHBI O.WRONLY+O.CREATE
|
>PUSHBI O.WRONLY+O.CREATE
|
||||||
>LDYAI PWD.FILE
|
>LDYAI PWD.FILE
|
||||||
ldx #SYS.FOpen
|
ldx #SYS.FOpen
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
bcc .1
|
bcc .1
|
||||||
|
|
||||||
pha
|
pha
|
||||||
@ -91,7 +91,7 @@ PWD.Store lda PWD.DBPtr
|
|||||||
>PUSHYA
|
>PUSHYA
|
||||||
lda .7+1
|
lda .7+1
|
||||||
ldx #SYS.FWrite
|
ldx #SYS.FWrite
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
bcs .2
|
bcs .2
|
||||||
|
|
||||||
jsr .7
|
jsr .7
|
||||||
@ -106,7 +106,7 @@ PWD.Store lda PWD.DBPtr
|
|||||||
|
|
||||||
.7 lda #$ff
|
.7 lda #$ff
|
||||||
ldx #SYS.fclose
|
ldx #SYS.fclose
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
|
|
||||||
.8 lda #$ff
|
.8 lda #$ff
|
||||||
jsr K.freemem
|
jsr K.freemem
|
||||||
|
@ -82,7 +82,7 @@ SLIST.GetData jsr SLIST.Select
|
|||||||
inc ZPSListDataLen+1
|
inc ZPSListDataLen+1
|
||||||
bra .2
|
bra .2
|
||||||
|
|
||||||
.99 lda #E.NODATA
|
.99 lda #E.EMPTYKEY
|
||||||
sec
|
sec
|
||||||
.9 rts
|
.9 rts
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ K.MkNod.I ldx #2
|
|||||||
|
|
||||||
>LDYA ZPPtr1
|
>LDYA ZPPtr1
|
||||||
ldx #SYS.StrDup
|
ldx #SYS.StrDup
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
bcs .9
|
bcs .9
|
||||||
txa
|
txa
|
||||||
|
|
||||||
|
@ -1,16 +1,10 @@
|
|||||||
NEW
|
NEW
|
||||||
PREFIX
|
AUTO 3,1
|
||||||
AUTO 4,1
|
|
||||||
*--------------------------------------
|
|
||||||
*K.PrintF.PadL .BS 1
|
|
||||||
*K.PrintF.PadC .BS 1
|
|
||||||
*HEXBUF .BS 4
|
|
||||||
*BCDBUF .BS 5 5, enough to handle 10 digits (32bits)
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
HEXBUF .EQ FAC
|
HEXBUF .EQ FAC
|
||||||
K.PrintF.PadL .EQ FAC+4
|
K.PrintF.PadL .EQ FAC+4
|
||||||
K.PrintF.PadC .EQ FAC+5
|
K.PrintF.PadC .EQ FAC+5
|
||||||
BCDBUF .EQ ARG
|
BCDBUF .EQ ARG 5, enough to handle 10 digits (32bits)
|
||||||
HEXBUF.Signed .EQ ARG.SIGN
|
HEXBUF.Signed .EQ ARG.SIGN
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # putchar (BLOCKING)
|
* # putchar (BLOCKING)
|
||||||
@ -29,14 +23,16 @@ K.PutChar >PUSHA character
|
|||||||
ldy #S.PS.hStdOut
|
ldy #S.PS.hStdOut
|
||||||
lda (pPs),y
|
lda (pPs),y
|
||||||
jsr K.FPutC
|
jsr K.FPutC
|
||||||
bcc .8
|
bcc K.PutChar.RTS
|
||||||
|
|
||||||
tay
|
tay E.NODATA
|
||||||
bne .8
|
bpl K.PutChar.RTS
|
||||||
|
|
||||||
>RET 1
|
inc 0 = BLOCKING
|
||||||
|
|
||||||
.8 rts
|
K.PutChar.RET1 inc pStack
|
||||||
|
|
||||||
|
K.PutChar.RTS rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # fputc (BLOCKING)
|
* # fputc (BLOCKING)
|
||||||
* Print A (char) to hFILE
|
* Print A (char) to hFILE
|
||||||
@ -50,22 +46,26 @@ K.PutChar >PUSHA character
|
|||||||
* ## RETURN VALUE
|
* ## RETURN VALUE
|
||||||
* CC = success
|
* CC = success
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
* (pStack)+0 character
|
|
||||||
*--------------------------------------
|
|
||||||
K.FPutC jsr PFT.CheckNodeA
|
K.FPutC jsr PFT.CheckNodeA
|
||||||
bcs .8
|
bcs K.PutChar.RET1
|
||||||
|
|
||||||
lda (pStack) character
|
lda (pStack) character
|
||||||
sta K.IOBuf
|
sta K.IOBuf
|
||||||
|
|
||||||
ldy #1 write 1 byte
|
lda #0
|
||||||
jsr K.FPutC.Y
|
>PUSHA
|
||||||
bcc .8
|
inc write 1 byte
|
||||||
tay
|
>PUSHA
|
||||||
bne .8
|
|
||||||
|
>PUSHWI K.IOBuf buf
|
||||||
|
jsr IO.Write.I
|
||||||
|
bcc K.PutChar.RET1 pop char...
|
||||||
|
tay E.NODATA
|
||||||
|
bpl K.PutChar.RET1
|
||||||
|
|
||||||
|
inc 0 = BLOCKING
|
||||||
|
sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.8 >RET 1
|
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # puts (BLOCKING)
|
* # puts (BLOCKING)
|
||||||
* Write Str to StdOut, appends '\r\n'
|
* Write Str to StdOut, appends '\r\n'
|
||||||
@ -78,36 +78,49 @@ K.FPutC jsr PFT.CheckNodeA
|
|||||||
* ## RETURN VALUE
|
* ## RETURN VALUE
|
||||||
* CC = success
|
* CC = success
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.PutS >PUSHYA
|
K.PutS >STYA ZPPtr2
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
|
||||||
|
.1 lda (ZPPtr2),y
|
||||||
|
beq .2
|
||||||
|
sta K.IOBuf,y
|
||||||
|
iny
|
||||||
|
bne .1
|
||||||
|
|
||||||
|
.9 lda #E.BUF
|
||||||
|
sec
|
||||||
|
rts
|
||||||
|
|
||||||
|
.2 lda #C.CR
|
||||||
|
sta K.IOBuf,y
|
||||||
|
iny
|
||||||
|
beq .9
|
||||||
|
|
||||||
|
lda #C.LF
|
||||||
|
sta K.IOBuf,y
|
||||||
|
|
||||||
|
iny
|
||||||
|
beq .9
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
sta K.IOBuf,y
|
||||||
|
|
||||||
|
>PUSHWI K.IOBuf
|
||||||
|
|
||||||
ldy #S.PS.hStdOut
|
ldy #S.PS.hStdOut
|
||||||
lda (pPs),y
|
lda (pPs),y
|
||||||
|
|
||||||
jsr K.FPutS
|
jsr K.FPutS
|
||||||
bcs K.PutS.RTS
|
bcc .99
|
||||||
|
|
||||||
lda #C.CR
|
|
||||||
sta K.IOBuf
|
|
||||||
lda #C.LF
|
|
||||||
sta K.IOBuf+1
|
|
||||||
|
|
||||||
ldy #2 write 2 bytes
|
|
||||||
|
|
||||||
K.FPutC.Y lda #0
|
|
||||||
|
|
||||||
>PUSHYA count
|
|
||||||
>PUSHWI K.IOBuf buf
|
|
||||||
jsr IO.Write.I
|
|
||||||
bcc K.PutS.RTS
|
|
||||||
tay
|
tay
|
||||||
bne K.PutS.RTS
|
bpl .99
|
||||||
|
|
||||||
>RET 4 pop buf,count but keep char
|
inc 0 = BLOCKING
|
||||||
|
* sec
|
||||||
K.PutS.RTS rts
|
.99 rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # fputs (BLOCKING)
|
* # fputs (BLOCKING)
|
||||||
* Write Str to FILE
|
* Write Str to hFILE
|
||||||
* ## C
|
* ## C
|
||||||
* `int fputs (hFILE stream, const char * str );`
|
* `int fputs (hFILE stream, const char * str );`
|
||||||
* ## ASM
|
* ## ASM
|
||||||
@ -121,23 +134,42 @@ K.PutS.RTS rts
|
|||||||
K.FPutS jsr PFT.CheckNodeA set IO.hFD
|
K.FPutS jsr PFT.CheckNodeA set IO.hFD
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
>PULLYA Get String
|
lda (pStack)
|
||||||
>STYA ZPPtr2 Save Buffer
|
sta ZPPtr2 Get String
|
||||||
ldx #SYS.strlen Get String len in Y,A
|
|
||||||
jsr K.SYSCALL.GoB
|
ldy #1
|
||||||
|
lda (pStack),y
|
||||||
|
sta ZPPtr2+1
|
||||||
|
|
||||||
|
* ldy #0
|
||||||
|
dey
|
||||||
|
ldx #0
|
||||||
|
|
||||||
|
.1 lda (ZPPtr2),y
|
||||||
|
beq .2
|
||||||
|
iny
|
||||||
|
bne .1
|
||||||
|
inx
|
||||||
|
bra .1
|
||||||
|
|
||||||
|
.2 txa
|
||||||
|
>PUSHA push len HI
|
||||||
|
|
||||||
|
tya
|
||||||
|
>PUSHA push len LO
|
||||||
|
|
||||||
|
>PUSHW ZPPtr2
|
||||||
|
|
||||||
>PUSHYA push len
|
|
||||||
>PUSHW ZPPtr2 push buffer
|
|
||||||
jsr IO.Write.I
|
jsr IO.Write.I
|
||||||
bcc .8
|
bcc .8
|
||||||
tay
|
tay
|
||||||
bne .8
|
bpl .9
|
||||||
|
|
||||||
>RET 4
|
inc 0 = BLOCKING
|
||||||
|
|
||||||
.8 rts
|
.8 rts
|
||||||
|
|
||||||
.9 >RET 2
|
.9 >RET 2 pop str
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # PrintF (BLOCKING)
|
* # PrintF (BLOCKING)
|
||||||
* # FPrintF (BLOCKING)
|
* # FPrintF (BLOCKING)
|
||||||
@ -361,9 +393,11 @@ K.PrintF.1 stz PrintF.Cnt
|
|||||||
jsr K.FWrite
|
jsr K.FWrite
|
||||||
bcc .81
|
bcc .81
|
||||||
tay
|
tay
|
||||||
bne .99
|
bpl .99
|
||||||
|
|
||||||
>RET 4
|
inc 0 = BLOCKING
|
||||||
|
* sec
|
||||||
|
rts
|
||||||
|
|
||||||
.80 lda #0 Writing to buffer, append \0
|
.80 lda #0 Writing to buffer, append \0
|
||||||
ldy PrintF.Cnt
|
ldy PrintF.Cnt
|
||||||
@ -812,7 +846,7 @@ K.FGetS jsr PFT.CheckNodeA
|
|||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
lda (pFD)
|
lda (pFD)
|
||||||
bne K.FGetS.Special
|
bra K.FGetS.Special
|
||||||
|
|
||||||
* clc
|
* clc
|
||||||
lda (pStack)
|
lda (pStack)
|
||||||
@ -906,17 +940,17 @@ K.FGetS.Special lda (pStack)
|
|||||||
|
|
||||||
.3 jsr K.GetC.I
|
.3 jsr K.GetC.I
|
||||||
bcc .2 another char...
|
bcc .2 another char...
|
||||||
|
|
||||||
.4 tay
|
.4 tay
|
||||||
bne .9 I/O error
|
bpl .9 I/O error
|
||||||
|
|
||||||
lda ZPPtr2
|
lda ZPPtr2
|
||||||
sta (pStack) s
|
sta (pStack) s
|
||||||
|
|
||||||
lda ZPPtr2+1
|
lda ZPPtr2+1
|
||||||
ldy #1
|
ldy #1
|
||||||
sta (pStack),y s
|
sta (pStack),y s
|
||||||
|
|
||||||
lda ZPPtr1
|
lda ZPPtr1
|
||||||
eor #$ff
|
eor #$ff
|
||||||
* sec
|
* sec
|
||||||
@ -929,11 +963,11 @@ K.FGetS.Special lda (pStack)
|
|||||||
adc #0
|
adc #0
|
||||||
iny
|
iny
|
||||||
sta (pStack),y !(n+2)
|
sta (pStack),y !(n+2)
|
||||||
|
|
||||||
lda #0 BLOCKING I/O
|
lda #0 BLOCKING
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.8 lda #0
|
.8 lda #0
|
||||||
sta (ZPPtr2) terminate string
|
sta (ZPPtr2) terminate string
|
||||||
clc
|
clc
|
||||||
@ -967,17 +1001,18 @@ K.GetChar ldy #S.PS.hStdIn
|
|||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.GetC jsr PFT.CheckNodeA
|
K.GetC jsr PFT.CheckNodeA
|
||||||
bcs K.GetC.RTS
|
bcs K.GetC.RTS
|
||||||
|
|
||||||
K.GetC.I >PUSHWI 1
|
K.GetC.I >PUSHWI 1
|
||||||
>PUSHWI K.IOBuf
|
>PUSHWI K.IOBuf
|
||||||
|
|
||||||
jsr IO.READ.I
|
jsr IO.READ.I
|
||||||
bcc .8
|
bcc .8
|
||||||
tay
|
tay
|
||||||
bne K.GetC.RTS I/O error
|
bpl K.GetC.RTS I/O error
|
||||||
|
|
||||||
>RET 4 BLOCKING I/O
|
inc 0 = BLOCKING
|
||||||
|
rts
|
||||||
|
|
||||||
.8 lda K.IOBuf
|
.8 lda K.IOBuf
|
||||||
|
|
||||||
K.GetC.RTS rts
|
K.GetC.RTS rts
|
||||||
@ -1008,7 +1043,7 @@ K.GetC.RTS rts
|
|||||||
* A = Number of arguments filled.
|
* A = Number of arguments filled.
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.SScanF jsr MEM.SPtr2PPtr1 ptr2=String to Scan,Ptr1=format
|
K.SScanF jsr MEM.SPtr2PPtr1 ptr2=String to Scan,Ptr1=format
|
||||||
|
|
||||||
stz .5+1 reset LStack Ptr
|
stz .5+1 reset LStack Ptr
|
||||||
stz .80+1 rest Arg processed
|
stz .80+1 rest Arg processed
|
||||||
|
|
||||||
@ -1017,18 +1052,18 @@ K.SScanF jsr MEM.SPtr2PPtr1 ptr2=String to Scan,Ptr1=format
|
|||||||
|
|
||||||
cmp #'%' Escape ?
|
cmp #'%' Escape ?
|
||||||
beq .2
|
beq .2
|
||||||
|
|
||||||
cmp #' ' Space ?
|
cmp #' ' Space ?
|
||||||
beq .12
|
beq .12
|
||||||
|
|
||||||
cmp (ZPPtr2) Same char in string?
|
cmp (ZPPtr2) Same char in string?
|
||||||
bne .9
|
bne .9
|
||||||
|
|
||||||
inc ZPPtr2
|
inc ZPPtr2
|
||||||
bne .1
|
bne .1
|
||||||
inc ZPPtr2+1
|
inc ZPPtr2+1
|
||||||
bra .1
|
bra .1
|
||||||
|
|
||||||
.12 inc ZPPtr2 Space....
|
.12 inc ZPPtr2 Space....
|
||||||
bne .14
|
bne .14
|
||||||
inc ZPPtr2+1
|
inc ZPPtr2+1
|
||||||
@ -1036,28 +1071,28 @@ K.SScanF jsr MEM.SPtr2PPtr1 ptr2=String to Scan,Ptr1=format
|
|||||||
.14 cmp (ZPPtr2) another one ?
|
.14 cmp (ZPPtr2) another one ?
|
||||||
beq .12
|
beq .12
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
.2 jsr MEM.GetCharPtr1 Get specifier after %
|
.2 jsr MEM.GetCharPtr1 Get specifier after %
|
||||||
beq .9 unexpected End of format after "%" ?
|
beq .9 unexpected End of format after "%" ?
|
||||||
|
|
||||||
ldx #K.SScanFJMP-K.SScanFTBL-2
|
ldx #K.SScanFJMP-K.SScanFTBL-2
|
||||||
|
|
||||||
.3 cmp K.SScanFTBL,x
|
.3 cmp K.SScanFTBL,x
|
||||||
beq .4
|
beq .4
|
||||||
dex
|
dex
|
||||||
dex
|
dex
|
||||||
bpl .3
|
bpl .3
|
||||||
|
|
||||||
.9 jsr .8
|
.9 jsr .8
|
||||||
lda #MLI.E.EOF
|
lda #MLI.E.EOF
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.4 jsr .5
|
.4 jsr .5
|
||||||
bcs .9 out of Ptr on stack
|
bcs .9 out of Ptr on stack
|
||||||
|
|
||||||
bra .1
|
bra .1
|
||||||
|
|
||||||
.8 lda pStack
|
.8 lda pStack
|
||||||
sec ByteCnt byte
|
sec ByteCnt byte
|
||||||
adc (pStack) ... ByteCnt
|
adc (pStack) ... ByteCnt
|
||||||
@ -1069,12 +1104,12 @@ K.SScanF jsr MEM.SPtr2PPtr1 ptr2=String to Scan,Ptr1=format
|
|||||||
.5 lda #$FF SELF MODIFIED LStack Ptr
|
.5 lda #$FF SELF MODIFIED LStack Ptr
|
||||||
cmp (pStack)
|
cmp (pStack)
|
||||||
beq .99 CS
|
beq .99 CS
|
||||||
|
|
||||||
tay
|
tay
|
||||||
iny
|
iny
|
||||||
lda (pStack),y
|
lda (pStack),y
|
||||||
sta ZPPtr3
|
sta ZPPtr3
|
||||||
|
|
||||||
iny
|
iny
|
||||||
lda (pStack),y
|
lda (pStack),y
|
||||||
sta ZPPtr3+1 get VAR Ptr
|
sta ZPPtr3+1 get VAR Ptr
|
||||||
@ -1110,11 +1145,11 @@ K.SScanF.H lda K.SScanFTBL+1,x Get VAR size
|
|||||||
pha
|
pha
|
||||||
|
|
||||||
jsr STDLIB.GetHex
|
jsr STDLIB.GetHex
|
||||||
|
|
||||||
K.SScanF.GetVAL jsr K.SScanF.Fwd Y=char count parsed
|
K.SScanF.GetVAL jsr K.SScanF.Fwd Y=char count parsed
|
||||||
|
|
||||||
.1 ply get back VAL size
|
.1 ply get back VAL size
|
||||||
|
|
||||||
.2 lda STDLIB.32-1,y
|
.2 lda STDLIB.32-1,y
|
||||||
dey
|
dey
|
||||||
sta (ZPPtr3),y
|
sta (ZPPtr3),y
|
||||||
@ -1134,7 +1169,7 @@ K.SScanF.S ldy #$ff
|
|||||||
bne .1
|
bne .1
|
||||||
.2 lda #0 add \0 to param ptr
|
.2 lda #0 add \0 to param ptr
|
||||||
sta (ZPPtr3),y
|
sta (ZPPtr3),y
|
||||||
|
|
||||||
K.SScanF.Fwd tya Y=char count parsed
|
K.SScanF.Fwd tya Y=char count parsed
|
||||||
clc
|
clc
|
||||||
adc ZPPtr2
|
adc ZPPtr2
|
||||||
@ -1185,7 +1220,7 @@ K.FOpen jsr PFT.CheckPathYA
|
|||||||
|
|
||||||
jsr STDIO.NewHFile
|
jsr STDIO.NewHFile
|
||||||
bcc K.FClose.RTS
|
bcc K.FClose.RTS
|
||||||
|
|
||||||
jmp IO.Open.ERR
|
jmp IO.Open.ERR
|
||||||
|
|
||||||
K.FOpen.RET4 >RET 4
|
K.FOpen.RET4 >RET 4
|
||||||
@ -1202,18 +1237,18 @@ K.FOpen.RET4 >RET 4
|
|||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.FClose jsr PFT.CheckNodeA
|
K.FClose jsr PFT.CheckNodeA
|
||||||
bcs K.FClose.RTS
|
bcs K.FClose.RTS
|
||||||
|
|
||||||
sta .1+1 store hFile
|
sta .1+1 store hFile
|
||||||
|
|
||||||
jsr IO.Close.I
|
jsr IO.Close.I
|
||||||
bcs K.FClose.RTS
|
bcs K.FClose.RTS
|
||||||
|
|
||||||
.1 ldx #$ff SELF MODIFIED
|
.1 ldx #$ff SELF MODIFIED
|
||||||
stz OF.Table.hFD-1,x
|
stz OF.Table.hFD-1,x
|
||||||
|
|
||||||
lda OF.Table.hPath-1,x
|
lda OF.Table.hPath-1,x
|
||||||
beq K.FClose.RTS special files have no path
|
beq K.FClose.RTS special files have no path
|
||||||
|
|
||||||
stz OF.Table.hPath-1,x
|
stz OF.Table.hPath-1,x
|
||||||
jmp K.FreeMem discard filename
|
jmp K.FreeMem discard filename
|
||||||
|
|
||||||
@ -1234,8 +1269,16 @@ K.FClose.RTS rts
|
|||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.FRead jsr PFT.CheckNodeA
|
K.FRead jsr PFT.CheckNodeA
|
||||||
bcs K.FOpen.RET4
|
bcs K.FOpen.RET4
|
||||||
|
|
||||||
jmp IO.Read.I
|
jsr IO.Read.I
|
||||||
|
bcc .9
|
||||||
|
|
||||||
|
tay
|
||||||
|
bpl .9
|
||||||
|
|
||||||
|
inc 0 = BLOCKING
|
||||||
|
|
||||||
|
.9 rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # FWrite (BLOCKING)
|
* # FWrite (BLOCKING)
|
||||||
* Write bytes to file
|
* Write bytes to file
|
||||||
@ -1252,8 +1295,16 @@ K.FRead jsr PFT.CheckNodeA
|
|||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.FWrite jsr PFT.CheckNodeA
|
K.FWrite jsr PFT.CheckNodeA
|
||||||
bcs K.FOpen.RET4
|
bcs K.FOpen.RET4
|
||||||
|
|
||||||
jmp IO.Write.I
|
jsr IO.Write.I
|
||||||
|
bcc .9
|
||||||
|
|
||||||
|
tay
|
||||||
|
bpl .9
|
||||||
|
|
||||||
|
inc 0 = BLOCKING
|
||||||
|
|
||||||
|
.9 rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # FFlush
|
* # FFlush
|
||||||
* ## C
|
* ## C
|
||||||
@ -1265,8 +1316,15 @@ K.FWrite jsr PFT.CheckNodeA
|
|||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.FFlush jsr PFT.CheckNodeA
|
K.FFlush jsr PFT.CheckNodeA
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
|
lda (pFD)
|
||||||
|
bne STDIO.IOERR
|
||||||
>MLICALL MLIFLUSH
|
>MLICALL MLIFLUSH
|
||||||
.9 rts
|
.9 rts
|
||||||
|
*--------------------------------------
|
||||||
|
STDIO.IOERR lda #MLI.E.IO
|
||||||
|
sec
|
||||||
|
rts
|
||||||
*/-------------------------------------
|
*/-------------------------------------
|
||||||
* # FSeek
|
* # FSeek
|
||||||
* Set the file-position indicator for hFILE
|
* Set the file-position indicator for hFILE
|
||||||
@ -1281,18 +1339,18 @@ K.FFlush jsr PFT.CheckNodeA
|
|||||||
*\-------------------------------------
|
*\-------------------------------------
|
||||||
K.FSeek jsr PFT.CheckNodeA
|
K.FSeek jsr PFT.CheckNodeA
|
||||||
bcc .11
|
bcc .11
|
||||||
|
|
||||||
>RET 6
|
>RET 5
|
||||||
|
|
||||||
.11 >PULLA whence
|
.11 >PULLA whence
|
||||||
tax
|
tax
|
||||||
>PULLW ZPPtr1 offset LW
|
>PULLW ZPPtr1 offset LW
|
||||||
>PULLW ZPPtr2 offset HW
|
>PULLW ZPPtr2 offset HW
|
||||||
cpx #SEEK.END+1
|
cpx #SEEK.END+1
|
||||||
bcs .98
|
bcs .98
|
||||||
|
|
||||||
jmp (.1,x)
|
jmp (.1,x)
|
||||||
|
|
||||||
.1 .DA .10
|
.1 .DA .10
|
||||||
.DA .20
|
.DA .20
|
||||||
.DA .30
|
.DA .30
|
||||||
@ -1313,9 +1371,9 @@ K.FSeek jsr PFT.CheckNodeA
|
|||||||
|
|
||||||
.8 ldy #0
|
.8 ldy #0
|
||||||
ldx #3 3 bytes, 24 bits!!!
|
ldx #3 3 bytes, 24 bits!!!
|
||||||
|
|
||||||
clc
|
clc
|
||||||
|
|
||||||
.81 lda K.MLI.PARAMS+2,y
|
.81 lda K.MLI.PARAMS+2,y
|
||||||
adc ZPPtr1,y
|
adc ZPPtr1,y
|
||||||
sta K.MLI.PARAMS+2,y
|
sta K.MLI.PARAMS+2,y
|
||||||
@ -1323,7 +1381,7 @@ K.FSeek jsr PFT.CheckNodeA
|
|||||||
iny
|
iny
|
||||||
dex
|
dex
|
||||||
bne .81
|
bne .81
|
||||||
|
|
||||||
bcs .99 Offset out of range!
|
bcs .99 Offset out of range!
|
||||||
|
|
||||||
.82 >MLICALL MLISETMARK
|
.82 >MLICALL MLISETMARK
|
||||||
@ -1357,9 +1415,9 @@ K.FSeek jsr PFT.CheckNodeA
|
|||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.FEOF jsr PFT.CheckNodeA
|
K.FEOF jsr PFT.CheckNodeA
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
jmp IO.EOF
|
jmp IO.EOF
|
||||||
|
|
||||||
.9 rts
|
.9 rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # FTell
|
* # FTell
|
||||||
@ -1377,17 +1435,17 @@ K.FTell jsr PFT.CheckNodeA
|
|||||||
bcs .9
|
bcs .9
|
||||||
>MLICALL MLIGETMARK
|
>MLICALL MLIGETMARK
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
>PUSHA
|
>PUSHA
|
||||||
|
|
||||||
ldy #2
|
ldy #2
|
||||||
|
|
||||||
.1 lda K.MLI.PARAMS+2,y
|
.1 lda K.MLI.PARAMS+2,y
|
||||||
>PUSHA
|
>PUSHA
|
||||||
dey
|
dey
|
||||||
bpl .1
|
bpl .1
|
||||||
|
|
||||||
.9 rts
|
.9 rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # Remove
|
* # Remove
|
||||||
@ -1402,7 +1460,7 @@ K.FTell jsr PFT.CheckNodeA
|
|||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
K.Remove jsr PFT.CheckPathYA
|
K.Remove jsr PFT.CheckPathYA
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
>MLICALL MLIDESTROY
|
>MLICALL MLIDESTROY
|
||||||
.9 rts
|
.9 rts
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
@ -1421,16 +1479,16 @@ K.Rename jsr PFT.CheckPathYA
|
|||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
>PULLW .1+1
|
>PULLW .1+1
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
|
|
||||||
.1 lda $ffff,y Self Modified
|
.1 lda $ffff,y Self Modified
|
||||||
beq .8
|
beq .8
|
||||||
iny
|
iny
|
||||||
sta K.Buf256,y
|
sta K.Buf256,y
|
||||||
cpy #MLI.MAXPATH
|
cpy #MLI.MAXPATH
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
.8 sty K.Buf256
|
.8 sty K.Buf256
|
||||||
>LDYAI K.Buf256
|
>LDYAI K.Buf256
|
||||||
>STYA K.MLI.PARAMS+3
|
>STYA K.MLI.PARAMS+3
|
||||||
@ -1449,30 +1507,30 @@ STDIO.NewHFile sta .4+1 Store hFD
|
|||||||
|
|
||||||
.1 lda OF.Table.hFD-1,x
|
.1 lda OF.Table.hFD-1,x
|
||||||
beq .2
|
beq .2
|
||||||
|
|
||||||
inx
|
inx
|
||||||
cpx #K.OF.MAX+1
|
cpx #K.OF.MAX+1
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
lda #E.OOH
|
lda #E.OOH
|
||||||
* sec
|
* sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.2 stx .3+1 Store hFILE
|
.2 stx .3+1 Store hFILE
|
||||||
|
|
||||||
lda (pFD)
|
lda (pFD)
|
||||||
cmp #S.FD.T.CDEV
|
cmp #S.FD.T.CDEV
|
||||||
beq .20
|
beq .20
|
||||||
|
|
||||||
cmp #S.FD.T.BDEV
|
cmp #S.FD.T.BDEV
|
||||||
bne .21
|
bne .21
|
||||||
|
|
||||||
.20 lda #0 No hPath for DEV
|
.20 lda #0 No hPath for DEV
|
||||||
bra .3
|
bra .3
|
||||||
|
|
||||||
.21 >LDYAI K.buf256
|
.21 >LDYAI K.buf256
|
||||||
ldx #SYS.strdup
|
ldx #SYS.strdup
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
txa
|
txa
|
||||||
@ -1483,14 +1541,10 @@ STDIO.NewHFile sta .4+1 Store hFD
|
|||||||
sta OF.Table.hFD-1,x
|
sta OF.Table.hFD-1,x
|
||||||
|
|
||||||
txa hFILE
|
txa hFILE
|
||||||
|
|
||||||
clc
|
clc
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
STDIO.IOERR lda #MLI.E.IO
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
MAN
|
MAN
|
||||||
SAVE USR/SRC/SYS/KERNEL.S.STDIO
|
SAVE USR/SRC/SYS/KERNEL.S.STDIO
|
||||||
LOAD USR/SRC/SYS/KERNEL.S
|
LOAD USR/SRC/SYS/KERNEL.S
|
||||||
|
@ -315,7 +315,7 @@ STDLIB.realpath.I
|
|||||||
ror .82+1
|
ror .82+1
|
||||||
|
|
||||||
ldx #SYS.ExpandStr
|
ldx #SYS.ExpandStr
|
||||||
jsr K.SYSCALL.GoB
|
jsr K.SYSCALL2.BANK
|
||||||
bcs STDLIB.32.RTS
|
bcs STDLIB.32.RTS
|
||||||
|
|
||||||
>STYA ZPPtr1
|
>STYA ZPPtr1
|
||||||
@ -426,8 +426,7 @@ STDLIB.realpath.I
|
|||||||
bpl .88
|
bpl .88
|
||||||
>LDYAI K.Buf256
|
>LDYAI K.Buf256
|
||||||
ldx #SYS.StrDup BANK 2
|
ldx #SYS.StrDup BANK 2
|
||||||
jsr K.SYSCALL.GoB
|
jmp K.SYSCALL2.BANK
|
||||||
rts
|
|
||||||
|
|
||||||
.88 clc
|
.88 clc
|
||||||
rts
|
rts
|
||||||
|
@ -266,8 +266,8 @@ DRV.TERM.READ jsr DRV.TERM.GetIOCTLBufCntDCB
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.9 lda #0 Error = char
|
.9 lda #E.NODATA
|
||||||
sec
|
* sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DRV.TERM.WRITE jsr DRV.TERM.GetIOCTLBufCntDCB
|
DRV.TERM.WRITE jsr DRV.TERM.GetIOCTLBufCntDCB
|
||||||
@ -296,6 +296,8 @@ DRV.TERM.WRITE jsr DRV.TERM.GetIOCTLBufCntDCB
|
|||||||
.DA DRV.TERM.ESC
|
.DA DRV.TERM.ESC
|
||||||
.DA DRV.TERM.CSI
|
.DA DRV.TERM.CSI
|
||||||
.DA DRV.TERM.IAC
|
.DA DRV.TERM.IAC
|
||||||
|
.DA DRV.TERM.G0
|
||||||
|
.DA DRV.TERM.G1
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DRV.TERM.COUT lda (ZPBufPtr)
|
DRV.TERM.COUT lda (ZPBufPtr)
|
||||||
|
|
||||||
@ -332,9 +334,7 @@ DRV.TERM.COUT lda (ZPBufPtr)
|
|||||||
.DA DRV.TERM.COUT.FS
|
.DA DRV.TERM.COUT.FS
|
||||||
.DA DRV.TERM.COUT.ESC
|
.DA DRV.TERM.COUT.ESC
|
||||||
|
|
||||||
.8 ldy #S.DCB.TTY.bINVERSE
|
.8 jsr SetCharAtCurPos
|
||||||
ora (ZPDCBPtr),y
|
|
||||||
jsr SetCharAtCurPos
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DRV.TERM.COUT.FS
|
DRV.TERM.COUT.FS
|
||||||
ldy #S.DCB.TTY.CH
|
ldy #S.DCB.TTY.CH
|
||||||
@ -378,8 +378,6 @@ DRV.TERM.COUT.DEL
|
|||||||
sta (ZPDCBPtr),y S.DCB.TTY.CH
|
sta (ZPDCBPtr),y S.DCB.TTY.CH
|
||||||
|
|
||||||
.3 lda #$20
|
.3 lda #$20
|
||||||
ldy #S.DCB.TTY.bINVERSE
|
|
||||||
ora (ZPDCBPtr),y
|
|
||||||
jmp SetCharAtCurPos
|
jmp SetCharAtCurPos
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DRV.TERM.COUT.FF
|
DRV.TERM.COUT.FF
|
||||||
@ -438,6 +436,8 @@ DRV.TERM.ESC1 lda #0 y = #S.DCB.TTY.MODE
|
|||||||
.4 .DA Scroll.Dn M
|
.4 .DA Scroll.Dn M
|
||||||
.DA Scroll.Up D
|
.DA Scroll.Up D
|
||||||
.DA RESET c
|
.DA RESET c
|
||||||
|
.DA G0 (
|
||||||
|
.DA G1 )
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DRV.TERM.CSI ldy #S.DCB.TTY.INBUFFER
|
DRV.TERM.CSI ldy #S.DCB.TTY.INBUFFER
|
||||||
lda (ZPDCBPtr),y
|
lda (ZPDCBPtr),y
|
||||||
@ -453,9 +453,7 @@ DRV.TERM.CSI ldy #S.DCB.TTY.INBUFFER
|
|||||||
cpy #S.DCB.TTY.INBUFFER.MAX-1 buffer full?
|
cpy #S.DCB.TTY.INBUFFER.MAX-1 buffer full?
|
||||||
bne .8
|
bne .8
|
||||||
|
|
||||||
lda #0
|
jmp RESET.MODE
|
||||||
ldy #S.DCB.TTY.MODE
|
|
||||||
sta (ZPDCBPtr),y
|
|
||||||
|
|
||||||
.8 clc
|
.8 clc
|
||||||
rts
|
rts
|
||||||
@ -526,9 +524,7 @@ DRV.TERM.CSI.Exec
|
|||||||
|
|
||||||
pha
|
pha
|
||||||
|
|
||||||
lda #0
|
jsr RESET.MODE
|
||||||
ldy #S.DCB.TTY.MODE
|
|
||||||
sta (ZPDCBPtr),y
|
|
||||||
|
|
||||||
pla
|
pla
|
||||||
|
|
||||||
@ -576,7 +572,9 @@ Csi.LWDisable clc
|
|||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Csi.DispAttr ldx CsiParamCnt
|
Csi.DispAttr ldx CsiParamCnt
|
||||||
beq .8
|
bne .1
|
||||||
|
|
||||||
|
jmp RESETATTR
|
||||||
|
|
||||||
.1 lda CsiParams-1,x
|
.1 lda CsiParams-1,x
|
||||||
bne .2
|
bne .2
|
||||||
@ -585,9 +583,9 @@ Csi.DispAttr ldx CsiParamCnt
|
|||||||
bra .7
|
bra .7
|
||||||
|
|
||||||
.2 eor #7
|
.2 eor #7
|
||||||
bne .8
|
bne .7
|
||||||
|
|
||||||
ldy #S.DCB.TTY.bINVERSE
|
.3 ldy #S.DCB.TTY.bINVERSE
|
||||||
sta (ZPDCBPtr),y
|
sta (ZPDCBPtr),y
|
||||||
|
|
||||||
.7 dex
|
.7 dex
|
||||||
@ -676,7 +674,7 @@ Csi.Home lda CsiParamCnt
|
|||||||
|
|
||||||
ldy #S.DCB.TTY.CH
|
ldy #S.DCB.TTY.CH
|
||||||
sta (ZPDCBPtr),y
|
sta (ZPDCBPtr),y
|
||||||
iny
|
iny S.DCB.TTY.CV
|
||||||
sta (ZPDCBPtr),y
|
sta (ZPDCBPtr),y
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
@ -718,6 +716,11 @@ Csi.Home lda CsiParamCnt
|
|||||||
Csi.Home.8 clc
|
Csi.Home.8 clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
DRV.TERM.G0
|
||||||
|
DRV.TERM.G1
|
||||||
|
|
||||||
|
jmp RESET.MODE
|
||||||
|
*--------------------------------------
|
||||||
DRV.TERM.IAC ldy #S.DCB.TTY.INBUFFER
|
DRV.TERM.IAC ldy #S.DCB.TTY.INBUFFER
|
||||||
lda (ZPDCBPtr),y
|
lda (ZPDCBPtr),y
|
||||||
inc
|
inc
|
||||||
@ -843,8 +846,7 @@ COUT.IAC.DONT
|
|||||||
COUT.IAC.EXIT
|
COUT.IAC.EXIT
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
RESET.MODE lda #0
|
RESET.MODE lda #0
|
||||||
|
SET.MODE ldy #S.DCB.TTY.MODE
|
||||||
ldy #S.DCB.TTY.MODE
|
|
||||||
sta (ZPDCBPtr),y
|
sta (ZPDCBPtr),y
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
@ -865,6 +867,12 @@ RESETATTR lda #$80
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
G0 lda #S.DCB.TTY.MODE.G0
|
||||||
|
.HS 2C BIT ABS
|
||||||
|
*--------------------------------------
|
||||||
|
G1 lda #S.DCB.TTY.MODE.G1
|
||||||
|
bra SET.MODE
|
||||||
|
*--------------------------------------
|
||||||
ENQ ldx #0
|
ENQ ldx #0
|
||||||
|
|
||||||
.1 lda ENQ.String,x
|
.1 lda ENQ.String,x
|
||||||
@ -1263,7 +1271,7 @@ RESET.VALUES .DA #0 S.DCB.TTY.MODE
|
|||||||
CtrlChars .HS 05080A0C0D151B
|
CtrlChars .HS 05080A0C0D151B
|
||||||
CtrlChars.Cnt .EQ *-CtrlChars
|
CtrlChars.Cnt .EQ *-CtrlChars
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
EscCodes .AZ "MDc"
|
EscCodes .AZ "MDc()"
|
||||||
EscCodes.Cnt .EQ *-EscCodes
|
EscCodes.Cnt .EQ *-EscCodes
|
||||||
CsiCodes .AS "hlmnrKH"
|
CsiCodes .AS "hlmnrKH"
|
||||||
CsiCodes.Cnt .EQ *-CsiCodes
|
CsiCodes.Cnt .EQ *-CsiCodes
|
||||||
|
@ -167,7 +167,9 @@ SetCharAtCurPos.SCR
|
|||||||
pla
|
pla
|
||||||
bra SetCharAtY.SCR
|
bra SetCharAtY.SCR
|
||||||
|
|
||||||
SetCharAtCurPos pha
|
SetCharAtCurPos ldy #S.DCB.TTY.bINVERSE
|
||||||
|
ora (ZPDCBPtr),y
|
||||||
|
pha
|
||||||
ldy #S.DCB.TTY.CV
|
ldy #S.DCB.TTY.CV
|
||||||
lda (ZPDCBPtr),y
|
lda (ZPDCBPtr),y
|
||||||
tax
|
tax
|
||||||
@ -226,6 +228,9 @@ GetCharAtCurPos ldy #S.DCB.TTY.CV
|
|||||||
|
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
REMAP.95.126 .HS 404142434445464748494a4b4c4d4e4f
|
||||||
|
.HS 505152535455565758595a5b5c5d5e5f
|
||||||
|
*--------------------------------------
|
||||||
BUF.BASEL .DA #0
|
BUF.BASEL .DA #0
|
||||||
.DA #80
|
.DA #80
|
||||||
.DA #160
|
.DA #160
|
||||||
|
Loading…
Reference in New Issue
Block a user