mirror of
https://github.com/A2osX/A2osX.git
synced 2025-01-26 18:32:56 +00:00
Kernel 0.94
This commit is contained in:
parent
4c75244dd1
commit
f1e78993d3
Binary file not shown.
@ -3,7 +3,7 @@ NEW
|
||||
.LIST OFF
|
||||
.OP 65C02
|
||||
.OR $2000
|
||||
.TF BIN/CHTYP
|
||||
.TF bin/chtyp
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
@ -162,10 +162,11 @@ CS.RUN.FILE jsr CS.RUN.GetFilePath
|
||||
>SYSCALL PrintF
|
||||
bcs .9
|
||||
|
||||
>PUSHW ZPFullPath
|
||||
|
||||
ldy #HexFileType
|
||||
>PUSHB (pData),y
|
||||
|
||||
>LDYA ZPFullPath
|
||||
>SYSCALL ChTyp
|
||||
jsr CS.RUN.CheckErr
|
||||
>LDA.G bRecurse
|
||||
|
@ -57,8 +57,8 @@ IO.Reset.In sec
|
||||
.8 clc
|
||||
IO.Reset.In.RTS rts
|
||||
*--------------------------------------
|
||||
IO.Pipe.Out >PUSHWZ mode
|
||||
>LEA.G IO.FIFO
|
||||
IO.Pipe.Out >PUSHEA.G IO.FIFO
|
||||
>PUSHWZ mode
|
||||
>SYSCALL MKFIFO
|
||||
bcs IO.Reset.In.RTS Create a new PIPE
|
||||
|
||||
|
@ -3,7 +3,7 @@ NEW
|
||||
.LIST OFF
|
||||
.OP 65C02
|
||||
.OR $2000
|
||||
.TF BIN/STAT
|
||||
.TF bin/stat
|
||||
*--------------------------------------
|
||||
.INB INC/MACROS.I
|
||||
.INB INC/A2OSX.I
|
||||
|
@ -185,9 +185,9 @@ CS.RUN.CLIENT >SLEEP give some time for TCPIP SYN/ACK
|
||||
>PUSHBI 1
|
||||
>SYSCALL sprintf
|
||||
|
||||
CS.RUN.CLIENT1 >PUSHB hClientSocket
|
||||
CS.RUN.CLIENT1 >PUSHEA.G NodBuf
|
||||
>PUSHW 0
|
||||
>LEA.G NodBuf
|
||||
>PUSHB hClientSocket
|
||||
>SYSCALL mknod
|
||||
bcs .9
|
||||
|
||||
|
@ -14,14 +14,11 @@ NEW
|
||||
* A = EC
|
||||
*\--------------------------------------
|
||||
K.OpenDir jsr PFT.CheckPath0
|
||||
bcs K.ReadDir.RTS
|
||||
|
||||
inc pStack
|
||||
inc pStack
|
||||
bcs .9
|
||||
|
||||
ldx #1
|
||||
jsr IO.MkFD
|
||||
bcs K.ReadDir.RTS
|
||||
bcs .9
|
||||
|
||||
lda K.Buf256+1 One char ("/") ?
|
||||
beq .8 No, Go open dir....
|
||||
@ -38,7 +35,9 @@ K.OpenDir jsr PFT.CheckPath0
|
||||
jsr STDIO.NewHFile
|
||||
|
||||
bcc K.ReadDir.RTS
|
||||
.98 jmp IO.OPEN.ERR
|
||||
.98 jmp UNISTD.Open.ERR
|
||||
|
||||
.9 >RET 2
|
||||
*/--------------------------------------
|
||||
* # ReadDir
|
||||
* ## C
|
||||
|
@ -138,7 +138,7 @@ Kernel.Init3C >PUSHWI MSG.Init3
|
||||
jsr CPU.Init.6502
|
||||
|
||||
jsr CPU.Init.Z80
|
||||
|
||||
|
||||
jsr DevMgrInit
|
||||
|
||||
jsr IrqMgrInit
|
||||
|
@ -30,18 +30,18 @@ IO.WRITE.REG ldx #MLIWRITE
|
||||
jsr GP.MLICall
|
||||
bcs .9
|
||||
>LDYA K.MLI.PARAMS+6
|
||||
.9 rts
|
||||
.9
|
||||
IO.WRITE.REG.RTS
|
||||
rts
|
||||
*--------------------------------------
|
||||
IO.OPEN.CDEV
|
||||
IO.OPEN.BDEV jsr SHARED.GetPDrv
|
||||
ldx #IOCTL.OPEN
|
||||
lda IO.hDev
|
||||
jsr SHARED.pDrvJmp
|
||||
bcs .9
|
||||
bcs IO.WRITE.REG.RTS
|
||||
|
||||
lda IO.hDev
|
||||
* clc
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
IO.CLOSE.CDEV
|
||||
IO.CLOSE.BDEV
|
||||
|
@ -22,6 +22,8 @@ K.PFTRemove.RTS rts
|
||||
*--------------------------------------
|
||||
PFT.CheckPath0 ldy #0
|
||||
.HS 2C BIT ABS
|
||||
PFT.CheckPath1 ldy #1
|
||||
.HS 2C BIT ABS
|
||||
PFT.CheckPath2 ldy #2
|
||||
.HS 2C BIT ABS
|
||||
PFT.CheckPath4 ldy #4
|
||||
|
@ -12,22 +12,17 @@ NEW
|
||||
* `>SYSCALL chtyp`
|
||||
* ## RETURN VALUE
|
||||
*\--------------------------------------
|
||||
K.ChTyp jsr PFT.CheckPath2
|
||||
bcs .99
|
||||
>PULLB .1+1
|
||||
|
||||
inc pStack
|
||||
inc pStack
|
||||
K.ChTyp jsr PFT.CheckPath1
|
||||
bcs .9
|
||||
|
||||
>MLICALL MLIGETFILEINFO
|
||||
bcs .9
|
||||
|
||||
.1 lda #$ff
|
||||
lda (pStack)
|
||||
sta K.MLI.PARAMS+S.FI.T
|
||||
>MLICALL MLISETFILEINFO
|
||||
.9 rts
|
||||
|
||||
.99 >RET 1 discard filetype
|
||||
.9 >RET 3
|
||||
*--------------------------------------
|
||||
* # ChMod
|
||||
* change permissions of a file
|
||||
@ -45,20 +40,20 @@ K.ChTyp jsr PFT.CheckPath2
|
||||
K.ChMod jsr PFT.CheckPath2
|
||||
bcs K.ChMod.RET4
|
||||
|
||||
>PULLW K.S.STAT+S.STAT.MODE
|
||||
|
||||
inc pStack
|
||||
inc pStack
|
||||
jsr STAT.PullPathAndMode
|
||||
|
||||
lda K.S.STAT+S.STAT.MODE+1
|
||||
and /S.STAT.MODE.RU
|
||||
beq .9
|
||||
|
||||
lda K.S.STAT+S.STAT.MODE
|
||||
and #S.STAT.MODE.XO+S.STAT.MODE.RO+S.STAT.MODE.XG+S.STAT.MODE.RG+S.STAT.MODE.XU+S.STAT.MODE.RU
|
||||
cmp #S.STAT.MODE.XO+S.STAT.MODE.RO+S.STAT.MODE.XG+S.STAT.MODE.RG+S.STAT.MODE.XU+S.STAT.MODE.RU
|
||||
bne .9
|
||||
|
||||
>MLICALL MLIGETFILEINFO
|
||||
bcs .90
|
||||
|
||||
lda K.MLI.PARAMS+S.FI.A
|
||||
and #$3D not S.FI.A.RN+S.FI.A.D+S.FI.A.W
|
||||
ora #S.FI.A.R
|
||||
@ -72,14 +67,18 @@ K.ChMod jsr PFT.CheckPath2
|
||||
ora #S.FI.A.RN
|
||||
tax
|
||||
tya
|
||||
|
||||
.1 bit #S.STAT.MODE.WU
|
||||
beq .2
|
||||
|
||||
txa
|
||||
ora #S.FI.A.D
|
||||
tax
|
||||
tya
|
||||
|
||||
.2 bit #S.STAT.MODE.WO
|
||||
beq .3
|
||||
|
||||
txa
|
||||
ora #S.FI.A.W
|
||||
tax
|
||||
@ -87,9 +86,11 @@ K.ChMod jsr PFT.CheckPath2
|
||||
|
||||
>MLICALL MLISETFILEINFO
|
||||
rts
|
||||
|
||||
.9 lda #E.SYN
|
||||
sec
|
||||
.90 rts
|
||||
|
||||
K.ChMod.RET4 >RET 4 discard statbuf
|
||||
*--------------------------------------
|
||||
* # FStat
|
||||
@ -183,34 +184,32 @@ K.Stat jsr PFT.CheckPath2
|
||||
* A = EC
|
||||
*\-------------------------------------
|
||||
K.MKDir jsr PFT.CheckPath2
|
||||
bcs .9
|
||||
bcs K.ChMod.RET4
|
||||
|
||||
* lda (pStack) TODO : mode
|
||||
jsr STAT.PullPathAndMode
|
||||
|
||||
lda #S.FI.T.DIR
|
||||
sta K.MLI.PARAMS+4
|
||||
stz K.MLI.PARAMS+5
|
||||
stz K.MLI.PARAMS+6
|
||||
lda #S.FI.ST.DIR
|
||||
jsr IO.MLI.CREATE
|
||||
|
||||
.9 >RET 4
|
||||
jmp IO.MLI.CREATE
|
||||
*/--------------------------------------
|
||||
* # MKFIFO
|
||||
* return a pathname to a new FIFO
|
||||
* ## C
|
||||
* `int mkfifo( char *pathname, int mode );`
|
||||
* `int mkfifo( char *pathname, int mode);`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* `>PUSHW pathname`
|
||||
* `>PUSHW mode`
|
||||
* `>LDYA pathname`
|
||||
* `>SYSCALL mkfifo`
|
||||
* ## RETURN VALUE
|
||||
* CC = OK, CS = ERROR
|
||||
* A = hFD
|
||||
*\--------------------------------------
|
||||
K.MKFIFO >STYA ZPPtr1 pathname buffer
|
||||
>PULLW K.S.STAT+S.STAT.MODE
|
||||
K.MKFIFO jsr STAT.PullPathAndMode
|
||||
|
||||
>LDYAI 512
|
||||
jsr K.pipe
|
||||
bcs K.Stat.Store.RTS
|
||||
@ -240,18 +239,18 @@ K.MKFIFO >STYA ZPPtr1 pathname buffer
|
||||
* `hFILE mknod(const char *pathname, int mode, hFD fd);`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* `>PUSHB fd`
|
||||
* `>PUSHW pathname`
|
||||
* `>PUSHW mode`
|
||||
* `>LDYA pathname`
|
||||
* `>PUSHB fd`
|
||||
* `>SYSCALL mknod`
|
||||
* ## RETURN VALUE
|
||||
* CC = OK, CS = ERROR
|
||||
* A = hFILE
|
||||
*\--------------------------------------
|
||||
K.MkNod >STYA ZPPtr1 pathname
|
||||
>PULLW K.S.STAT+S.STAT.MODE
|
||||
>PULLB IO.hFD
|
||||
|
||||
K.MkNod >PULLB IO.hFD
|
||||
|
||||
jsr STAT.PullPathAndMode
|
||||
|
||||
K.MkNod.I ldx #2
|
||||
.1 lda Nod.Table.hPath-2,x
|
||||
beq .2
|
||||
@ -318,13 +317,18 @@ K.Pipe sta .1+1 SIZE HI
|
||||
.99
|
||||
K.Pipe.RTS rts
|
||||
*--------------------------------------
|
||||
SHARED.Stat.I jsr SHARED.ClrStat
|
||||
|
||||
>MLICALL MLIGETFILEINFO
|
||||
STAT.PullPathAndMode
|
||||
>PULLW K.S.STAT+S.STAT.MODE
|
||||
>PULLW ZPPtr1 pathname
|
||||
rts
|
||||
*--------------------------------------
|
||||
SHARED.Stat.I >MLICALL MLIGETFILEINFO
|
||||
bcs K.Pipe.RTS
|
||||
|
||||
SHARED.GFI2Stat jsr SHARED.ClrStat
|
||||
|
||||
lda K.MLI.PARAMS+S.FI.A
|
||||
jsr SHARED.Stat.Access2Mode
|
||||
jsr SHARED.Access2Mode
|
||||
|
||||
ldx #SHARED.GFI.Cnt
|
||||
|
||||
@ -336,18 +340,13 @@ SHARED.Stat.I jsr SHARED.ClrStat
|
||||
bne .3
|
||||
|
||||
>LDYAI K.MLI.PARAMS+S.FI.CDATE
|
||||
ldx #S.STAT.CTIME
|
||||
ldx #K.S.STAT+S.STAT.CTIME
|
||||
jsr SHARED.PTime2StatYAX
|
||||
|
||||
>LDYAI K.MLI.PARAMS+S.FI.MDATE
|
||||
ldx #S.STAT.MTIME
|
||||
ldx #K.S.STAT+S.STAT.MTIME
|
||||
jmp SHARED.PTime2StatYAX
|
||||
*--------------------------------------
|
||||
SHARED.GFI2Stat
|
||||
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
SHARED.DirEnt2Stat
|
||||
jsr SHARED.ClrStat
|
||||
|
||||
@ -371,14 +370,14 @@ SHARED.DirEnt2Stat
|
||||
ldy #$1E ProDOS Access
|
||||
lda (ZPPtr3),y
|
||||
|
||||
jsr SHARED.Stat.Access2Mode
|
||||
jsr SHARED.Access2Mode
|
||||
|
||||
lda #$18 creation Date/time
|
||||
ldx #S.STAT.CTIME
|
||||
ldx #K.S.STAT+S.STAT.CTIME
|
||||
jsr SHARED.PTime2StatAX
|
||||
|
||||
lda #$21 mod Date/time
|
||||
ldx #S.STAT.MTIME
|
||||
ldx #K.S.STAT+S.STAT.MTIME
|
||||
jmp SHARED.PTime2StatAX
|
||||
*--------------------------------------
|
||||
SHARED.ClrStat ldx #S.STAT-1
|
||||
@ -392,7 +391,11 @@ SHARED.ClrStat ldx #S.STAT-1
|
||||
|
||||
rts
|
||||
*--------------------------------------
|
||||
SHARED.Stat.Access2Mode
|
||||
SHARED.Mode2Access
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
SHARED.Access2Mode
|
||||
and #S.FI.A.FULL
|
||||
cmp #S.FI.A.FULL
|
||||
beq .7
|
||||
@ -434,13 +437,9 @@ SHARED.PTime2StatAX
|
||||
SHARED.PTime2StatYAX
|
||||
>PUSHYA
|
||||
|
||||
>PUSHB /K.S.STAT
|
||||
txa
|
||||
clc
|
||||
adc #K.S.STAT
|
||||
tay
|
||||
lda /K.S.STAT
|
||||
adc #0
|
||||
>PUSHYA
|
||||
>PUSHA
|
||||
>SYSCALL2 PTime2Time
|
||||
rts
|
||||
*--------------------------------------
|
||||
|
@ -4,7 +4,7 @@ NEW
|
||||
* # putchar (BLOCKING)
|
||||
* Print A (char) to StdOut
|
||||
* ## C
|
||||
* `int putchar ( int character );`
|
||||
* `int putchar ( short int character );`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* `lda character`
|
||||
@ -31,7 +31,7 @@ K.PutChar.RTS rts
|
||||
* # fputc (BLOCKING)
|
||||
* Print A (char) to hFILE
|
||||
* ## C
|
||||
* `int fputc ( hFILE stream , int character );`
|
||||
* `int fputc ( hFILE stream , short int character );`
|
||||
* ## ASM
|
||||
* **In:**
|
||||
* `>PUSHB character`
|
||||
@ -342,7 +342,7 @@ STDIO.Read.1 lda #0
|
||||
* CS : A = EC
|
||||
*\--------------------------------------
|
||||
K.FOpen jsr PFT.CheckPath4
|
||||
bcs K.FOpen.RET4
|
||||
bcs K.FOpen.RET6
|
||||
|
||||
>PULLW IO.Open.AUXTYPE
|
||||
>PULLB IO.Open.TYPE
|
||||
@ -357,9 +357,9 @@ K.FOpen jsr PFT.CheckPath4
|
||||
jsr STDIO.NewHFile
|
||||
bcc K.FClose.RTS
|
||||
|
||||
jmp IO.Open.ERR
|
||||
jmp UNISTD.Open.ERR
|
||||
|
||||
K.FOpen.RET4 >RET 4
|
||||
K.FOpen.RET6 >RET 6
|
||||
*/--------------------------------------
|
||||
* # FClose
|
||||
* Close a file
|
||||
@ -402,7 +402,7 @@ K.FClose jsr PFT.CheckNodeA
|
||||
* Y,A = Bytes Read
|
||||
*\--------------------------------------
|
||||
K.FRead jsr PFT.CheckNodeA
|
||||
bcs K.FOpen.RET4
|
||||
bcs K.FWrite.RET4
|
||||
|
||||
jsr UNISTD.Read
|
||||
bcs K.FWrite.9
|
||||
@ -423,7 +423,7 @@ K.FClose.RTS rts
|
||||
* Y,A = Bytes Written
|
||||
*\--------------------------------------
|
||||
K.FWrite jsr PFT.CheckNodeA
|
||||
bcs K.FOpen.RET4
|
||||
bcs K.FWrite.RET4
|
||||
|
||||
jsr UNISTD.Write
|
||||
bcc K.FWrite.RTS
|
||||
@ -438,6 +438,8 @@ K.FWrite.9 tay
|
||||
inc 0 = BLOCKING
|
||||
|
||||
K.FWrite.RTS rts
|
||||
|
||||
K.FWrite.RET4 >RET 4
|
||||
*/--------------------------------------
|
||||
* # FFlush
|
||||
* ## C
|
||||
@ -600,7 +602,7 @@ K.Remove jsr PFT.CheckPath0
|
||||
bcs .9
|
||||
|
||||
>MLICALL MLIDESTROY
|
||||
.9 rts
|
||||
.9 >RET 2
|
||||
*/--------------------------------------
|
||||
* # Rename
|
||||
* Rename a file
|
||||
@ -616,9 +618,14 @@ K.Remove jsr PFT.CheckPath0
|
||||
K.Rename jsr PFT.CheckPath2
|
||||
bcs .9
|
||||
|
||||
>PULLW ZPPtr1
|
||||
|
||||
ldy #0
|
||||
lda (pStack)
|
||||
sta ZPPtr1
|
||||
|
||||
ldy #1
|
||||
lda (pStack),y
|
||||
sta ZPPtr1+1
|
||||
|
||||
dey ldy #0
|
||||
|
||||
.1 lda (ZPPtr1),y
|
||||
beq .8
|
||||
@ -632,8 +639,8 @@ K.Rename jsr PFT.CheckPath2
|
||||
>LDYAI K.Buf256
|
||||
>STYA K.MLI.PARAMS+3
|
||||
>MLICALL MLIRENAME
|
||||
rts
|
||||
.9 >RET 2
|
||||
|
||||
.9 >RET 4
|
||||
*--------------------------------------
|
||||
* K.Buf256 = filepath
|
||||
* X = hFD
|
||||
@ -664,8 +671,7 @@ STDIO.NewHFile sta .4+1 Store hFD
|
||||
bra .3
|
||||
|
||||
.21 >LDYAI K.buf256
|
||||
ldx #SYS.strdup
|
||||
jsr K.SYSCALL2
|
||||
>SYSCALL2 StrDup
|
||||
bcs .9
|
||||
|
||||
txa
|
||||
|
@ -79,27 +79,16 @@ K.PrintF ldy #S.PS.hStdOut
|
||||
lda (pPS),y
|
||||
sta PrintF.hFILE
|
||||
|
||||
clc
|
||||
jsr STDIO.GetFormat
|
||||
|
||||
bra K.PrintF.1
|
||||
ldx #1
|
||||
.HS 2C BIT ABS
|
||||
*--------------------------------------
|
||||
K.FPrintf clc
|
||||
jsr STDIO.GetFormat
|
||||
|
||||
lda (pStack),y hFILE
|
||||
sta PrintF.hFILE
|
||||
|
||||
iny
|
||||
|
||||
bra K.PrintF.1
|
||||
K.FPrintf ldx #2
|
||||
.HS 2C BIT ABS
|
||||
*--------------------------------------
|
||||
K.SPrintf stz PrintF.hFILE
|
||||
|
||||
sec Format & buffer
|
||||
jsr STDIO.GetFormat
|
||||
K.SPrintf ldx #3
|
||||
*--------------------------------------
|
||||
K.PrintF.1 sty STDIO.Exit.Cnt+1 Total bytes to POP
|
||||
K.PrintF.1 jsr STDIO.GetFormat
|
||||
sty STDIO.Exit.Cnt+1 Total bytes to POP
|
||||
|
||||
stz PrintF.Cnt
|
||||
stz PrintF.Cnt+1
|
||||
@ -309,6 +298,7 @@ PrintF.StrNum ldy #0
|
||||
bcc .2
|
||||
|
||||
.9 rts
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
PrintF.StrNum.Err
|
||||
@ -350,6 +340,7 @@ PrintF.SS ldy #$00 PSTR
|
||||
bne .1
|
||||
.8 clc
|
||||
rts
|
||||
|
||||
.2 lda K.PrintF.PadL
|
||||
beq .8
|
||||
.3 cpy K.PrintF.PadL
|
||||
@ -357,6 +348,7 @@ PrintF.SS ldy #$00 PSTR
|
||||
lda K.PrintF.PadC
|
||||
jsr PrintF.COut
|
||||
bcs .9
|
||||
|
||||
iny
|
||||
bne .3
|
||||
|
||||
@ -383,7 +375,6 @@ PrintF.H.1 jsr MATH.AToHexAX
|
||||
jsr PrintF.COut
|
||||
bcs PrintF.COut.RTS
|
||||
txa
|
||||
jmp PrintF.COut
|
||||
*--------------------------------------
|
||||
PrintF.COut phy
|
||||
ldy PrintF.Cnt
|
||||
@ -398,6 +389,7 @@ PrintF.COut phy
|
||||
inc PrintF.Cnt+1
|
||||
.8 clc
|
||||
rts
|
||||
|
||||
.9 lda #E.BUF
|
||||
sec
|
||||
PrintF.COut.RTS rts
|
||||
@ -450,27 +442,16 @@ K.ScanF ldy #S.PS.hStdIn
|
||||
lda (pPS),y
|
||||
sta PrintF.hFILE
|
||||
|
||||
clc
|
||||
jsr STDIO.GetFormat
|
||||
|
||||
bra K.SScanF.1
|
||||
ldx #1
|
||||
.HS 2C BIT ABS
|
||||
*--------------------------------------
|
||||
K.FScanF clc
|
||||
jsr STDIO.GetFormat
|
||||
|
||||
lda (pStack),y hFILE
|
||||
sta PrintF.hFILE
|
||||
|
||||
iny
|
||||
|
||||
bra K.SScanF.1
|
||||
K.FScanF ldx #2
|
||||
.HS 2C BIT ABS
|
||||
*--------------------------------------
|
||||
K.SScanF stz PrintF.hFILE
|
||||
|
||||
sec Format & buffer
|
||||
jsr STDIO.GetFormat
|
||||
K.SScanF ldx #3
|
||||
*--------------------------------------
|
||||
K.SScanF.1 sty STDIO.Exit.Cnt+1 Total bytes to POP
|
||||
K.SScanF.1 jsr STDIO.GetFormat
|
||||
sty STDIO.Exit.Cnt+1 Total bytes to POP
|
||||
|
||||
.1 jsr SHARED.GetCharPtr2 End Of format?
|
||||
beq .8
|
||||
@ -589,6 +570,11 @@ K.SScanF.S ldy #$ff
|
||||
|
||||
K.SScanF.Fwd jmp SHARED.AddYToPtr1 Y=char count parsed
|
||||
*--------------------------------------
|
||||
* Y = Bytecount
|
||||
* X = 3 : get format & buffer
|
||||
* X = 2 : get format & hFile
|
||||
* X = 1 : get format only
|
||||
*--------------------------------------
|
||||
STDIO.GetFormat lda (pStack) Bytecount
|
||||
|
||||
tay
|
||||
@ -603,7 +589,13 @@ STDIO.GetFormat lda (pStack) Bytecount
|
||||
sta ZPPtr2+1
|
||||
iny
|
||||
|
||||
bcc .1
|
||||
dex
|
||||
beq .1
|
||||
|
||||
dex
|
||||
beq .2
|
||||
|
||||
.3 stz PrintF.hFILE
|
||||
|
||||
lda (pStack),y str LO
|
||||
sta pIOBuf
|
||||
@ -613,6 +605,11 @@ STDIO.GetFormat lda (pStack) Bytecount
|
||||
iny
|
||||
|
||||
rts
|
||||
|
||||
.2 lda (pStack),y hFILE
|
||||
sta PrintF.hFILE
|
||||
|
||||
iny
|
||||
|
||||
.1 lda #K.IOBuf
|
||||
sta pIOBuf
|
||||
|
@ -12,19 +12,6 @@ NEW
|
||||
* CS: Y,A = NULL
|
||||
*\--------------------------------------
|
||||
K.StrVGet >PULLW FORPNT ptr
|
||||
|
||||
>PULLA index
|
||||
eor #$ff
|
||||
tax
|
||||
|
||||
>PULLA
|
||||
|
||||
sta SETREADAUX
|
||||
sta SETWRITEAUX
|
||||
jsr STRVX.StrVGet
|
||||
sta CLRREADAUX
|
||||
sta CLRWRITEAUX
|
||||
rts
|
||||
*/--------------------------------------
|
||||
* # StrVShift
|
||||
* ## ASM
|
||||
@ -35,16 +22,10 @@ K.StrVGet >PULLW FORPNT ptr
|
||||
*\--------------------------------------
|
||||
K.StrVShift >PULLA index
|
||||
eor #$ff
|
||||
tax
|
||||
tay
|
||||
|
||||
>PULLA
|
||||
|
||||
sta SETREADAUX
|
||||
sta SETWRITEAUX
|
||||
jsr STRVX.StrVShift
|
||||
sta CLRREADAUX
|
||||
sta CLRWRITEAUX
|
||||
rts
|
||||
>PULLA hSTRV
|
||||
jmp K.SYSCALL.JMPX
|
||||
*/--------------------------------------
|
||||
* # StrVAdd
|
||||
* ## ASM
|
||||
@ -57,7 +38,7 @@ K.StrVShift >PULLA index
|
||||
*\--------------------------------------
|
||||
K.StrVAdd >PULLW TXTPTR str
|
||||
>PULLA
|
||||
jmp K.SYSCALL.JMPX
|
||||
jmp K.SYSCALL.JMPX
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE USR/SRC/SYS/KERNEL.S.STRV
|
||||
|
@ -1,9 +1,13 @@
|
||||
NEW
|
||||
AUTO 3,1
|
||||
*--------------------------------------
|
||||
STRVX.StrVShift jsr K.GetMemPtr
|
||||
STRVX.StrVShift phy
|
||||
|
||||
jsr K.GetMemPtr
|
||||
>STYA ZPPtr1 strV
|
||||
|
||||
plx
|
||||
|
||||
.1 inx
|
||||
beq .2
|
||||
|
||||
@ -21,9 +25,13 @@ STRVX.StrVShift jsr K.GetMemPtr
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
STRVX.StrVGet jsr K.GetMemPtr
|
||||
STRVX.StrVGet phy
|
||||
|
||||
jsr K.GetMemPtr
|
||||
>STYA ZPPtr1 strV
|
||||
|
||||
plx
|
||||
|
||||
.1 inx
|
||||
beq .2
|
||||
|
||||
|
@ -77,14 +77,18 @@ UNISTD.Open ldx #5 /DEV/
|
||||
lda Nod.Table.hFD-2,x return hFD
|
||||
jsr UNISTD.GetPFD
|
||||
bra .71
|
||||
|
||||
.3 inx
|
||||
cpx #K.NOD.MAX+2
|
||||
bne .10
|
||||
|
||||
lda #MLI.E.NODEV
|
||||
* sec
|
||||
rts no OF found
|
||||
|
||||
.7 stx IO.hDev
|
||||
>STYA pFD
|
||||
|
||||
.71 lda (pFD) #S.FD.T
|
||||
tax
|
||||
jmp (.8-4,x)
|
||||
@ -117,7 +121,7 @@ IO.OPEN.REG.E ldx #0
|
||||
jsr IO.MkFD
|
||||
bcs IO.OPEN.RTS
|
||||
jsr IO.MLI.OPEN
|
||||
bcs IO.OPEN.ERR
|
||||
bcs UNISTD.Open.ERR
|
||||
lda IO.Open.FLAGS
|
||||
bit #O.WRONLY
|
||||
beq .20 Write mode ?
|
||||
@ -129,9 +133,9 @@ IO.OPEN.REG.E ldx #0
|
||||
>MLICALL MLISETEOF no, reset size to 0
|
||||
bra .21
|
||||
.11 >MLICALL MLIGETEOF
|
||||
bcs IO.OPEN.ERR
|
||||
bcs UNISTD.Open.ERR
|
||||
>MLICALL MLISETMARK
|
||||
.21 bcs IO.OPEN.ERR
|
||||
.21 bcs UNISTD.Open.ERR
|
||||
.20 lda IO.Open.FLAGS
|
||||
and #O.TEXT Text Mode ?
|
||||
beq .8
|
||||
@ -140,11 +144,11 @@ IO.OPEN.REG.E ldx #0
|
||||
lda #C.CR
|
||||
sta K.MLI.PARAMS+3
|
||||
>MLICALL MLINEWLINE
|
||||
bcs IO.OPEN.ERR
|
||||
bcs UNISTD.Open.ERR
|
||||
.8 lda IO.hFD
|
||||
IO.OPEN.RTS rts
|
||||
|
||||
IO.OPEN.ERR pha Save Error Code
|
||||
UNISTD.Open.ERR pha Save Error Code
|
||||
lda IO.hFD
|
||||
jsr K.Close
|
||||
pla
|
||||
|
Loading…
x
Reference in New Issue
Block a user