Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-08-25 12:56:00 +02:00
parent 4dbe39ffce
commit ad26c6d710
18 changed files with 158 additions and 120 deletions

View File

@ -575,6 +575,17 @@ CS : not found
## RETURN VALUE ## RETURN VALUE
# CloseSession
## C
`int closesession(short int hSID);`
## ASM
`>PUSHB hSID`
`>SYSCALL CloseSession`
## RETURN VALUE
# OpenSession # OpenSession
## C ## C
@ -633,17 +644,6 @@ CS : not found
## RETURN VALUE ## RETURN VALUE
# CloseSession
## C
`int closesession(short int hSID);`
## ASM
`>PUSHB hSID`
`>SYSCALL CloseSession`
## RETURN VALUE
# SListGetData # SListGetData
## ASM ## ASM
@ -880,8 +880,8 @@ Write Str to hFILE
## ASM ## ASM
**In:** **In:**
`>PUSHB stream`
`>PUSHW str` `>PUSHW str`
`lda stream`
`>SYSCALL fputs` `>SYSCALL fputs`
## RETURN VALUE ## RETURN VALUE
@ -1016,7 +1016,7 @@ Read bytes from file
Write bytes to file Write bytes to file
## C ## C
`int fwrite (short int stream, const void * ptr, int count );` `int fwrite ( short int stream, const void * ptr, int count );`
## ASM ## ASM
**In:** **In:**
@ -1382,9 +1382,12 @@ Y,A = destination
# StrDup # StrDup
Create a new copy of this C-String Create a new copy of this C-String
Y,A = Ptr to source C-String
## RETURN VALUE ## C
`char * strdup ( char * str);`
## ASM
Y,A = Ptr to source C-String
CC : success CC : success
Y,A = PTR to String Y,A = PTR to String
X = hMem (C-String) X = hMem (C-String)

Binary file not shown.

Binary file not shown.

View File

@ -106,7 +106,7 @@ CS.RUN dec AttrAND set mask = $ff
*-------------------------------------- *--------------------------------------
CS.RUN.LOOP ldy #S.PS.hStdIn CS.RUN.LOOP ldy #S.PS.hStdIn
lda (pPS),y lda (pPS),y
>SYSCALL feof >SYSCALL FEOF
bcs .99 bcs .99
tay tay
@ -322,7 +322,7 @@ CS.RUN.CheckSwitch
bne .9 bne .9
>LDYA ZPPtr1 >LDYA ZPPtr1
>SYSCALL strupr >SYSCALL StrUpr
ldx #AttrMask-AttrList2-1 ldx #AttrMask-AttrList2-1

View File

@ -64,11 +64,13 @@ CS.RUN
lda ArgCount lda ArgCount
>SYSCALL ArgV >SYSCALL ArgV
bcs .7 bcs .7
>STYA ZPPtr1 >STYA ZPPtr1
lda (ZPPtr1) lda (ZPPtr1)
cmp #'-' cmp #'-'
bne .4 bne .4
ldy #1 ldy #1
lda (ZPPtr1),y lda (ZPPtr1),y
@ -91,13 +93,17 @@ CS.RUN
lda #$80 lda #$80
sta 0,y sta 0,y
bra .1 bra .1
.4 inc FileCount .4 inc FileCount
bra .1 scan for any other args bra .1 scan for any other args
.7 lda FileCount .7 lda FileCount
beq .99 beq .99
>LDYAI 256 >LDYAI 256
>SYSCALL GetMem >SYSCALL GetMem
bcs .9 bcs .9
>STYA ZPBufPtr >STYA ZPBufPtr
stx hBuf stx hBuf
*-------------------------------------- *--------------------------------------
@ -105,13 +111,16 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
lda (pPS),y lda (pPS),y
>SYSCALL FEOF >SYSCALL FEOF
bcs .90 IO error bcs .90 IO error
tay tay
bne .10 no char bne .10 no char
>SYSCALL GetChar >SYSCALL GetChar
bcs .9 IO error bcs .9 IO error
cmp #$03 Ctrl-C cmp #$03 Ctrl-C
beq .9 Abort.... beq .9 Abort....
cmp #$13 Ctrl-S cmp #$13 Ctrl-S
bne .10 bne .10
@ -124,17 +133,21 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
.11 lda hFile .11 lda hFile
bne .2 bne .2
.1 inc ArgIndex .1 inc ArgIndex
lda ArgIndex lda ArgIndex
>SYSCALL ArgV >SYSCALL ArgV
bcs .99 No more arg...the end! bcs .99 No more arg...the end!
>STYA ZPPtr1 >STYA ZPPtr1
lda (ZPPtr1) lda (ZPPtr1)
cmp #'-' cmp #'-'
beq .1 An option, skip... beq .1 An option, skip...
>LDYA ZPPtr1 >LDYA ZPPtr1
jsr CS.RUN.OPEN jsr CS.RUN.OPEN
.90 bcs .9 .90 bcs .9
sta hFile sta hFile
.2 >PUSHWI 254 Leave room for CRLF .2 >PUSHWI 254 Leave room for CRLF
@ -147,8 +160,10 @@ CS.RUN.LOOP ldy #S.PS.hStdIn
jsr CS.RUN.PRINT jsr CS.RUN.PRINT
bcc CS.RUN.LOOP bcc CS.RUN.LOOP
rts rts
.7 cmp #MLI.E.EOF .7 cmp #MLI.E.EOF
bne .9 bne .9
jsr CS.RUN.CLOSE jsr CS.RUN.CLOSE
jmp CS.RUN.LOOP jmp CS.RUN.LOOP
@ -166,29 +181,39 @@ CS.RUN.OPEN stz bPrintedBlankLine Reset this flag for the new file
*-------------------------------------- *--------------------------------------
CS.RUN.PRINT inc LineNum CS.RUN.PRINT inc LineNum
bne .10 bne .10
inc LineNum+1 inc LineNum+1
.10 lda bSuppressBlankLine .10 lda bSuppressBlankLine
bpl .2 bpl .2
lda (ZPBufPtr) lda (ZPBufPtr)
bne .1 Empty line ? bne .1 Empty line ?
lda bPrintedBlankLine lda bPrintedBlankLine
bmi .8 bmi .8
lda #$ff lda #$ff
sta bPrintedBlankLine sta bPrintedBlankLine
bra .2 bra .2
.1 stz bPrintedBlankLine .1 stz bPrintedBlankLine
.2 jsr CS.RUN.PRINTNUM .2 jsr CS.RUN.PRINTNUM
bcs .99 bcs .99
lda bPrintAll lda bPrintAll
bmi .3 bmi .3
ldy #$ff ldy #$ff
.20 iny .20 iny
lda (ZPBufPtr),y lda (ZPBufPtr),y
beq .21 beq .21
cmp #C.SPACE cmp #C.SPACE
bcs .20 bcs .20
lda #C.SPACE lda #C.SPACE
sta (ZPBufPtr),y sta (ZPBufPtr),y
bra .20 bra .20
@ -198,17 +223,22 @@ CS.RUN.PRINT inc LineNum
rts rts
.3 stz ByteIndex .3 stz ByteIndex
.4 ldy ByteIndex .4 ldy ByteIndex
lda (ZPBufPtr),y lda (ZPBufPtr),y
beq .7 beq .7
cmp #C.SPACE cmp #C.SPACE
bcc .5 bcc .5
>SYSCALL PutChar >SYSCALL PutChar
.99 bcs .9 .99 bcs .9
bra .62 bra .62
.8 clc .8 clc
rts rts
.5 tax .5 tax
>LDYA L.ASCII >LDYA L.ASCII
@ -228,6 +258,7 @@ CS.RUN.PRINT inc LineNum
>PUSHBI 2 >PUSHBI 2
>SYSCALL PrintF >SYSCALL PrintF
bcs .9 bcs .9
.62 inc ByteIndex .62 inc ByteIndex
bne .4 bne .4
@ -253,7 +284,9 @@ CS.QUIT lda hBuf
CS.RUN.CLOSE lda hFile CS.RUN.CLOSE lda hFile
beq .8 beq .8
stz hFile stz hFile
>SYSCALL FClose >SYSCALL FClose
.8 clc .8 clc
rts rts

View File

@ -118,7 +118,7 @@ CS.RUN >INC.G ArgIndex
*-------------------------------------- *--------------------------------------
CS.RUN.LOOP ldy #S.PS.hStdIn CS.RUN.LOOP ldy #S.PS.hStdIn
lda (pPS),y lda (pPS),y
>SYSCALL feof >SYSCALL FEOF
bcs .99 bcs .99
tay tay

View File

@ -119,7 +119,7 @@ CS.RUN >INC.G ArgIndex
*-------------------------------------- *--------------------------------------
CS.RUN.LOOP ldy #S.PS.hStdIn CS.RUN.LOOP ldy #S.PS.hStdIn
lda (pPS),y lda (pPS),y
>SYSCALL feof >SYSCALL FEOF
bcs .99 bcs .99
tay tay
@ -210,7 +210,7 @@ CS.RUN.DIR lda (ZPFileName)
>PUSHW ZPFullPath >PUSHW ZPFullPath
>PUSHB.G UID >PUSHB.G UID
>PUSHBI 255 >PUSHBI 255
>SYSCALL chown >SYSCALL ChOwn
jsr CS.RUN.CheckErr jsr CS.RUN.CheckErr
bcs .9 bcs .9

View File

@ -158,9 +158,9 @@ CS.RUN.IPOK ldy #S.PS.ARGC
lda #1 lda #1
>SYSCALL ArgV >SYSCALL ArgV
>PUSHYA >PUSHYA
>LIBCALL hLIBTCPIP,LIBTCPIP.HST.GETBYNAME >LIBCALL hLIBTCPIP,LIBTCPIP.HST.GetByName
bcc CS.RUN.HOSTOK bcc CS.RUN.HOSTOK
lda TimeOut lda TimeOut
bne .2 bne .2
>PUSHW L.MSG.UNKNOWN >PUSHW L.MSG.UNKNOWN
@ -180,7 +180,7 @@ CS.RUN.IPOK ldy #S.PS.ARGC
CS.RUN.HOSTOK lda #2 CS.RUN.HOSTOK lda #2
>SYSCALL ArgV >SYSCALL ArgV
>SYSCALL atoi >SYSCALL AToI
>STYA SA.REMOTE+S.SOCKADDR.PORT >STYA SA.REMOTE+S.SOCKADDR.PORT
>PUSHW L.MSG.HOSTOK >PUSHW L.MSG.HOSTOK
@ -270,7 +270,7 @@ CS.RUN.OPENSKT >PUSHBI 0 no protocol
CS.RUN.LOOP >SLEEP CS.RUN.LOOP >SLEEP
lda hFile lda hFile
>SYSCALL feof >SYSCALL FEOF
bcs .9 bcs .9
tay tay
@ -288,7 +288,7 @@ CS.RUN.LOOP >SLEEP
.2 ldy #S.PS.hStdIn .2 ldy #S.PS.hStdIn
lda (pPS),y lda (pPS),y
>SYSCALL feof >SYSCALL FEOF
bcs .9 bcs .9
tay tay
bne CS.RUN.LOOP EOF = true, no char from STDIN bne CS.RUN.LOOP EOF = true, no char from STDIN
@ -312,13 +312,13 @@ CS.RUN.MkNod >PUSHEA.G NodBuf
>PUSHW L.NOD.Template >PUSHW L.NOD.Template
>PUSHB hSocket >PUSHB hSocket
>PUSHBI 1 >PUSHBI 1
>SYSCALL sprintf >SYSCALL SPrintF
bcs .9 bcs .9
>PUSHEA.G NodBuf >PUSHEA.G NodBuf
>PUSHW 0 >PUSHW 0
>PUSHB hSocket >PUSHB hSocket
>SYSCALL mknod >SYSCALL MKNod
bcs .9 bcs .9
>PUSHEA.G NodBuf >PUSHEA.G NodBuf
@ -656,7 +656,7 @@ CS.RUN.CMD.376
CS.RUN.GetMsg >PUSHWI MSGSIZE CS.RUN.GetMsg >PUSHWI MSGSIZE
>PUSHW ZPMsgPtr >PUSHW ZPMsgPtr
lda hFile lda hFile
>SYSCALL fgets >SYSCALL FGetS
bcs .9 bcs .9
lda (ZPMsgPtr) lda (ZPMsgPtr)
@ -967,12 +967,12 @@ CS.DOEVENT lda (pEvent)
CS.QUIT lda hFile CS.QUIT lda hFile
beq .1 beq .1
>SYSCALL fclose >SYSCALL FClose
.1 lda hSocket .1 lda hSocket
beq .2 beq .2
* >LIBCALL hLIBTCPIP,LIBTCPIP.Shutdown >LIBCALL hLIBTCPIP,LIBTCPIP.Shutdown
.2 lda hText .2 lda hText
beq .3 beq .3
@ -1058,8 +1058,7 @@ NOD.Template .AZ "/dev/irc%h"
DS.START DS.START
NULLSTRING .BS 1 NULLSTRING .BS 1
NodBuf .BS 11 NodBuf .BS 11
DS.END DS.END .ED
.ED
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/bin/irc.s SAVE usr/src/bin/irc.s

View File

@ -6,9 +6,9 @@ AUTO 4,1
.OR $2000 .OR $2000
.TF bin/kconfig .TF bin/kconfig
*-------------------------------------- *--------------------------------------
.INB INC/MACROS.I .INB inc/macros.i
.INB INC/MLI.I .INB inc/mli.i
.INB INC/A2OSX.I .INB inc/a2osx.i
*-------------------------------------- *--------------------------------------
.DUMMY .DUMMY
.OR ZPBIN .OR ZPBIN
@ -406,5 +406,5 @@ DS.START
StatBuf .BS S.STAT StatBuf .BS S.STAT
DS.END .ED DS.END .ED
MAN MAN
SAVE USR/SRC/BIN/KCONFIG.S SAVE usr/src/bin/kconfig.s
ASM ASM

View File

@ -104,7 +104,7 @@ CS.RUN >INC.G ArgIndex
*-------------------------------------- *--------------------------------------
CS.RUN.LOOP ldy #S.PS.hStdIn CS.RUN.LOOP ldy #S.PS.hStdIn
lda (pPS),y lda (pPS),y
>SYSCALL feof >SYSCALL FEOF
bcs .99 bcs .99
tay tay
@ -265,7 +265,7 @@ CS.RUN.GetNewPath
>SYSCALL StrCpy >SYSCALL StrCpy
>LDYA ZPFileName >LDYA ZPFileName
>SYSCALL strlwr >SYSCALL StrLwr
>PUSHW ZPFileName >PUSHW ZPFileName
>LDYA ZPNewPath >LDYA ZPNewPath
@ -341,9 +341,7 @@ hFile .BS 1
hMem .BS 1 hMem .BS 1
.INB usr/src/bin/x.fileenum.g .INB usr/src/bin/x.fileenum.g
DS.END .ED
DS.END
.ED
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/bin/lc.s SAVE usr/src/bin/lc.s

View File

@ -415,8 +415,8 @@ CS.RUN.OpenArc >LDA.G ArcName
>STA.G hArcFile >STA.G hArcFile
>PUSHB.G hArcFile
>PUSHW L.ARC.Header >PUSHW L.ARC.Header
>LDA.G hArcFile
>SYSCALL FPutS >SYSCALL FPutS
.9 .9
CS.RUN.OpenArc.RTS CS.RUN.OpenArc.RTS
@ -509,8 +509,8 @@ CS.RUN.WriteArcHdr
jsr CS.RUN.WriteArcByteA jsr CS.RUN.WriteArcByteA
bcs CS.RUN.WriteArcHdr.9 bcs CS.RUN.WriteArcHdr.9
>PUSHB.G hArcFile
>PUSHW ZPRelPath >PUSHW ZPRelPath
>LDA.G hArcFile
>SYSCALL FPutS >SYSCALL FPutS
CS.RUN.WriteArcHdr.9 CS.RUN.WriteArcHdr.9
@ -683,5 +683,5 @@ DS.END
.ED .ED
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/PAK.S SAVE usr/src/bin/pak.s
ASM ASM

View File

@ -5,12 +5,12 @@ NEW
.OR $2000 .OR $2000
.TF bin/pakme .TF bin/pakme
*-------------------------------------- *--------------------------------------
.INB INC/MACROS.I .INB inc/macros.i
.INB INC/A2OSX.I .INB inc/a2osx.i
.INB INC/KERNEL.I .INB inc/kernel.i
.INB INC/PAK.I .INB inc/pak.i
.INB INC/LIBPAK.I .INB inc/libpak.i
.INB INC/MLI.E.I .INB inc/mli.e.i
*-------------------------------------- *--------------------------------------
CHUNK.MAX .EQ 32 CHUNK.MAX .EQ 32
*-------------------------------------- *--------------------------------------
@ -126,19 +126,19 @@ CS.RUN.START >PUSHW L.MSG.SRCFILE
>PUSHWZ >PUSHWZ
>PUSHWZ >PUSHWZ
lda hSrcFile lda hSrcFile
>SYSCALL fseek >SYSCALL FSeek
bcs CS.RUN.RTS bcs CS.RUN.RTS
>PUSHW ZPDstTableOfs >PUSHW ZPDstTableOfs
>PUSHW ZPSrcBufPtr >PUSHW ZPSrcBufPtr
lda hSrcFile lda hSrcFile
>SYSCALL fread >SYSCALL FRead
bcs CS.RUN.RTS bcs CS.RUN.RTS
>PUSHW ZPDstTableOfs >PUSHW ZPDstTableOfs
>PUSHW ZPSrcBufPtr >PUSHW ZPSrcBufPtr
lda hDstFile lda hDstFile
>SYSCALL fwrite >SYSCALL FWrite
bcs CS.RUN.RTS bcs CS.RUN.RTS
jsr CS.QUIT.BUF jsr CS.QUIT.BUF
@ -151,7 +151,7 @@ CS.RUN.RTS rts
*-------------------------------------- *--------------------------------------
CS.RUN.LOOP ldy #S.PS.hStdIn CS.RUN.LOOP ldy #S.PS.hStdIn
lda (pPS),y lda (pPS),y
>SYSCALL feof >SYSCALL FEOF
bcs CS.RUN.RTS bcs CS.RUN.RTS
tay tay
@ -228,7 +228,7 @@ CS.RUN.CheckSrcFile
>PUSHB hSrcFile >PUSHB hSrcFile
>PUSHEA.G STATBUF >PUSHEA.G STATBUF
>SYSCALL fstat >SYSCALL FStat
.99 bcs .9 .99 bcs .9
>LDA.G STATBUF+S.STAT.SIZE+3 >LDA.G STATBUF+S.STAT.SIZE+3
@ -271,13 +271,13 @@ CS.RUN.CheckTAG >PUSHBI SEEK.SET
>PUSHYA >PUSHYA
lda hSrcFile lda hSrcFile
>SYSCALL fseek >SYSCALL FSeek
bcs CS.RUN.CheckSrcFile.RTS bcs CS.RUN.CheckSrcFile.RTS
>PUSHWI 10 >PUSHWI 10
>PUSHEA.G PAKME.HEADER >PUSHEA.G PAKME.HEADER
lda hSrcFile lda hSrcFile
>SYSCALL fread >SYSCALL FRead
bcs CS.RUN.CheckSrcFile.RTS bcs CS.RUN.CheckSrcFile.RTS
ldx #4 ldx #4
@ -311,7 +311,7 @@ CS.RUN.GetTable >LDA.G PAKME.HEADER+8
>PUSHWZ >PUSHWZ
>PUSHW ZPDstTableOfs >PUSHW ZPDstTableOfs
lda hSrcFile lda hSrcFile
>SYSCALL fseek >SYSCALL FSeek
bcs .9 bcs .9
>LDA.G PAKME.HEADER+7 >LDA.G PAKME.HEADER+7
@ -324,7 +324,7 @@ CS.RUN.GetTable >LDA.G PAKME.HEADER+8
>PUSHEA.G PAKME.TABLE >PUSHEA.G PAKME.TABLE
lda hSrcFile lda hSrcFile
>SYSCALL fread >SYSCALL FRead
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
@ -352,13 +352,13 @@ CS.RUN.GetChunk lda ZPChunkIndex
>PUSHWZ >PUSHWZ
>PUSHW ZPChunkOfs >PUSHW ZPChunkOfs
lda hSrcFile lda hSrcFile
>SYSCALL fseek >SYSCALL FSeek
bcs .9 bcs .9
>PUSHWI 3 >PUSHWI 3
>PUSHEA.G CHUNK.HEADER >PUSHEA.G CHUNK.HEADER
lda hSrcFile lda hSrcFile
>SYSCALL fread >SYSCALL FRead
bcs .9 bcs .9
>LDA.G CHUNK.HEADER >LDA.G CHUNK.HEADER
@ -378,7 +378,7 @@ CS.RUN.GetChunk lda ZPChunkIndex
>PUSHW ZPChunkLen >PUSHW ZPChunkLen
>PUSHW ZPSrcBufPtr >PUSHW ZPSrcBufPtr
lda hSrcFile lda hSrcFile
>SYSCALL fread >SYSCALL FRead
bcs .9 bcs .9
* clc * clc
@ -416,7 +416,7 @@ CS.RUN.RewriteTable
>PUSHWZ >PUSHWZ
>PUSHW ZPDstTableOfs >PUSHW ZPDstTableOfs
lda hDstFile lda hDstFile
>SYSCALL fseek >SYSCALL FSeek
bcs CS.RUN.WriteTable.RTS bcs CS.RUN.WriteTable.RTS
*-------------------------------------- *--------------------------------------
CS.RUN.WriteTable CS.RUN.WriteTable
@ -427,12 +427,12 @@ CS.RUN.WriteTable
>PUSHYA >PUSHYA
>PUSHEA.G PAKME.TABLE >PUSHEA.G PAKME.TABLE
lda hDstFile lda hDstFile
>SYSCALL fwrite >SYSCALL FWrite
CS.RUN.WriteTable.RTS CS.RUN.WriteTable.RTS
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.WritePak lda hDstFile CS.RUN.WritePak lda hDstFile
>SYSCALL ftell >SYSCALL FTell
bcs .9 bcs .9
>PULLW ZPChunkNewOfs >PULLW ZPChunkNewOfs
@ -442,7 +442,7 @@ CS.RUN.WritePak lda hDstFile
>PUSHW ZPChunkPakedLen >PUSHW ZPChunkPakedLen
>PUSHW ZPDstBufPtr >PUSHW ZPDstBufPtr
lda hDstFile lda hDstFile
>SYSCALL fwrite >SYSCALL FWrite
bcs .9 bcs .9
>PUSHW L.MSG.PAKED >PUSHW L.MSG.PAKED
@ -457,7 +457,7 @@ CS.RUN.WritePak.RTS
*-------------------------------------- *--------------------------------------
CS.RUN.WriteStore CS.RUN.WriteStore
lda hDstFile lda hDstFile
>SYSCALL ftell >SYSCALL FTell
bcs CS.RUN.WritePak.RTS bcs CS.RUN.WritePak.RTS
>PULLW ZPChunkNewOfs >PULLW ZPChunkNewOfs
@ -467,13 +467,13 @@ CS.RUN.WriteStore
>PUSHWI 3 >PUSHWI 3
>PUSHEA.G CHUNK.HEADER >PUSHEA.G CHUNK.HEADER
lda hDstFile lda hDstFile
>SYSCALL fwrite >SYSCALL FWrite
bcs .9 bcs .9
>PUSHW ZPChunkLen >PUSHW ZPChunkLen
>PUSHW ZPSrcBufPtr >PUSHW ZPSrcBufPtr
lda hDstFile lda hDstFile
>SYSCALL fwrite >SYSCALL FWrite
bcs .9 bcs .9
>PUSHW L.MSG.STORE >PUSHW L.MSG.STORE
@ -569,5 +569,5 @@ PAKSTAT .BS S.PAKSTAT
DS.END .ED DS.END .ED
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/BIN/PAKME.S SAVE usr/src/bin/pakme.s
ASM ASM

View File

@ -300,10 +300,11 @@ CL.PrintEOL >LDA.G CL.Ptr
CL.PrintEOL.8 clc CL.PrintEOL.8 clc
rts rts
*-------------------------------------- *--------------------------------------
CL.PrintCLBuf >PUSHW ZPCLBuf CL.PrintCLBuf ldy #S.PS.hStdOut
ldy #S.PS.hStdOut
lda (pPS),y lda (pPS),y
>PUSHA
>PUSHW ZPCLBuf
>SYSCALL FPutS >SYSCALL FPutS
rts rts
*-------------------------------------- *--------------------------------------

View File

@ -245,9 +245,11 @@ CORE.Run.7 jsr CORE.GetCharNB
jsr IO.Pipe.Out jsr IO.Pipe.Out
bcs CORE.Run.Exit bcs CORE.Run.Exit
lda #S.PS.F.HOLD+S.PS.F.CLOSEONX Run in the background... lda #S.PS.F.HOLD Run in the background...
tsb CORE.PSFlags ...and close PIPE OUT on exit trb CORE.PSFlags
lda #S.PS.F.CLOSEONX ...and close PIPE OUT on exit
tsb CORE.PSFlags
jsr CORE.ExecCmd jsr CORE.ExecCmd
php php

View File

@ -121,7 +121,7 @@ CS.RUN.DUMP lda ArgFile
>SYSCALL PrintF >SYSCALL PrintF
jsr Mod2CSTR jsr Mod2CSTR
>PUSHW L.MSG.MOD >PUSHW L.MSG.Mod
>PUSHEA.G MOD >PUSHEA.G MOD
>PUSHBI 2 >PUSHBI 2
>SYSCALL PrintF >SYSCALL PrintF

View File

@ -81,7 +81,7 @@ CS.RUN lda #1
CS.RUN.LOOP >SLEEP CS.RUN.LOOP >SLEEP
lda hDev lda hDev
>SYSCALL feof >SYSCALL FEOF
bcs .99 bcs .99
tay tay
bne .2 EOF, no char bne .2 EOF, no char
@ -89,7 +89,7 @@ CS.RUN.LOOP >SLEEP
>PUSHWI BUFSIZE >PUSHWI BUFSIZE
>PUSHW ZPBufPtr >PUSHW ZPBufPtr
lda hDev lda hDev
>SYSCALL fRead >SYSCALL FRead
bcc .1 bcc .1
.99 rts .99 rts
@ -97,13 +97,13 @@ CS.RUN.LOOP >SLEEP
>PUSHW ZPBufPtr >PUSHW ZPBufPtr
ldy #S.PS.hStdOut ldy #S.PS.hStdOut
lda (pPS),y lda (pPS),y
>SYSCALL fwrite >SYSCALL FWrite
bcs .9 bcs .9
.2 ldy #S.PS.hStdIn .2 ldy #S.PS.hStdIn
lda (pPS),y lda (pPS),y
>SYSCALL feof >SYSCALL FEOF
bcs .9 bcs .9
tay tay
bne CS.RUN.LOOP EOF = true, no char from STDIN bne CS.RUN.LOOP EOF = true, no char from STDIN
@ -112,7 +112,7 @@ CS.RUN.LOOP >SLEEP
>PUSHW ZPBufPtr >PUSHW ZPBufPtr
ldy #S.PS.hStdIn ldy #S.PS.hStdIn
lda (pPS),y lda (pPS),y
>SYSCALL fread >SYSCALL FRead
.3 bcs .9 .3 bcs .9
>STYA ZPBufLen >STYA ZPBufLen
@ -123,7 +123,7 @@ CS.RUN.LOOP >SLEEP
>PUSHW ZPBufLen >PUSHW ZPBufLen
>PUSHW ZPBufPtr >PUSHW ZPBufPtr
lda hDev lda hDev
>SYSCALL fWrite >SYSCALL FWrite
bcs .9 bcs .9
jmp CS.RUN.LOOP jmp CS.RUN.LOOP

View File

@ -104,7 +104,7 @@ CS.RUN >INC.G ArgIndex
*-------------------------------------- *--------------------------------------
CS.RUN.LOOP ldy #S.PS.hStdIn CS.RUN.LOOP ldy #S.PS.hStdIn
lda (pPS),y lda (pPS),y
>SYSCALL feof >SYSCALL FEOF
bcs .99 bcs .99
tay tay
@ -265,7 +265,7 @@ CS.RUN.GetNewPath
>SYSCALL StrCpy >SYSCALL StrCpy
>LDYA ZPFileName >LDYA ZPFileName
>SYSCALL strupr >SYSCALL StrUpr
>PUSHW ZPFileName >PUSHW ZPFileName
>LDYA ZPNewPath >LDYA ZPNewPath
@ -341,9 +341,7 @@ hFile .BS 1
hMem .BS 1 hMem .BS 1
.INB usr/src/bin/x.fileenum.g .INB usr/src/bin/x.fileenum.g
DS.END .ED
DS.END
.ED
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/bin/uc.s SAVE usr/src/bin/uc.s

View File

@ -17,17 +17,14 @@ 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 K.PutChar.RTS bcc .8
cmp #E.NODATA tay
sec bne .8
bne K.PutChar.RTS
inc 0 = BLOCKING >PULLA CS,A=0:BLOCKING, restore A
K.PutChar.RET1 inc pStack .8 rts
K.PutChar.RTS rts
*/-------------------------------------- */--------------------------------------
* # fputc (BLOCKING) * # fputc (BLOCKING)
* Print A (char) to hFILE * Print A (char) to hFILE
@ -42,7 +39,7 @@ K.PutChar.RTS rts
* CC = success * CC = success
*\-------------------------------------- *\--------------------------------------
K.FPutC jsr PFT.CheckNodeA K.FPutC jsr PFT.CheckNodeA
bcs K.PutChar.RET1 bcs .8
lda (pStack) character lda (pStack) character
sta K.IOBuf sta K.IOBuf
@ -54,13 +51,16 @@ K.FPutC jsr PFT.CheckNodeA
>PUSHWI K.IOBuf buf >PUSHWI K.IOBuf buf
jsr UNISTD.Write jsr UNISTD.Write
bcc K.PutChar.RET1 pop char... bcc .8 pop char...
cmp #E.NODATA cmp #E.NODATA
sec sec
bne K.PutChar.RET1 bne .8
inc 0 = BLOCKING inc CS,A=0:BLOCKING
* sec rts
.8 >POP 1
rts rts
*/-------------------------------------- */--------------------------------------
* # puts (BLOCKING) * # puts (BLOCKING)
@ -74,12 +74,13 @@ K.FPutC jsr PFT.CheckNodeA
* ## RETURN VALUE * ## RETURN VALUE
* CC = success * CC = success
*\-------------------------------------- *\--------------------------------------
K.PutS >STYA ZPPtr2 K.PutS >STYA .1+1
ldy #0 ldy #0
.1 lda (ZPPtr2),y .1 lda $FFFF,y SELF MODIFIED
beq .2 beq .2
sta K.IOBuf,y sta K.IOBuf,y
iny iny
bne .1 bne .1
@ -95,27 +96,26 @@ K.PutS >STYA ZPPtr2
lda #C.LF lda #C.LF
sta K.IOBuf,y sta K.IOBuf,y
iny iny
beq .9 beq .9
lda #0 lda #0
sta K.IOBuf,y sta K.IOBuf,y
>PUSHWI K.IOBuf
ldy #S.PS.hStdOut ldy #S.PS.hStdOut
lda (pPS),y lda (pPS),y
>PUSHA
>PUSHWI K.IOBuf
jsr K.FPutS jsr K.FPutS
bcc K.PutS.RTS bcc K.PutS.RTS
tay
cmp #E.NODATA
sec
bne K.PutS.RTS bne K.PutS.RTS
inc 0 = BLOCKING >LDYA .1+1 CS,A=0:BLOCKING, restore Y,A
K.PutS.RET2 >POP 2 pop K.IOBuf K.PutS.RET3 >POP 3 pop StdOut & buffer
K.PutS.RTS rts K.PutS.RTS rts
*/-------------------------------------- */--------------------------------------
* # fputs (BLOCKING) * # fputs (BLOCKING)
@ -124,30 +124,33 @@ K.PutS.RTS rts
* `int fputs (hFILE stream, const char * str );` * `int fputs (hFILE stream, const char * str );`
* ## ASM * ## ASM
* **In:** * **In:**
* `>PUSHB stream`
* `>PUSHW str` * `>PUSHW str`
* `lda stream`
* `>SYSCALL fputs` * `>SYSCALL fputs`
* ## RETURN VALUE * ## RETURN VALUE
* CC = success * CC = success
*\-------------------------------------- *\--------------------------------------
K.FPutS jsr PFT.CheckNodeA set IO.hFD K.FPutS jsr PFT.CheckNode2 set IO.hFD
bcs K.PutS.RET2 bcs K.PutS.RET3
lda (pStack) lda (pStack)
sta ZPPtr2 Get String sta ZPPtr2 Get String
ldy #1 ldy #1
lda (pStack),y lda (pStack),y
sta ZPPtr2+1 sta ZPPtr2+1
* ldy #0
dey ldy #0
ldx #0 ldx #0
.1 lda (ZPPtr2),y .1 lda (ZPPtr2),y
beq .2 beq .2
iny iny
bne .1 bne .1
inx inx
bra .1 bra .1
.2 txa .2 txa
>PUSHA push len HI >PUSHA push len HI
@ -156,14 +159,15 @@ K.FPutS jsr PFT.CheckNodeA set IO.hFD
>PUSHW ZPPtr2 >PUSHW ZPPtr2
jsr UNISTD.Write jsr UNISTD.Write
bcc K.PutS.RET2 bcc K.PutS.RET3
cmp #E.NODATA cmp #E.NODATA
sec sec
bne K.PutS.RET2 IO Error bne K.PutS.RET3 IO Error
inc FF-> 0 = BLOCKING inc FF-> 0 = BLOCKING
* sec
K.FPutS.RTS rts K.FPutS.RTS rts
*/-------------------------------------- */--------------------------------------
* # fgets (BLOCKING) * # fgets (BLOCKING)
* read bytes from stream into the array * read bytes from stream into the array