Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-05-25 23:03:11 +02:00
parent 604bff6087
commit 1722e9cde0
9 changed files with 93 additions and 90 deletions

Binary file not shown.

Binary file not shown.

View File

@ -5,11 +5,11 @@ NEW
.OR $2000
.TF bin/cut
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/KERNEL.I
.INB INC/MLI.I
.INB INC/MLI.E.I
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/kernel.i
.INB inc/mli.i
.INB inc/mli.e.i
*--------------------------------------
.DUMMY
.OR ZPBIN
@ -96,11 +96,13 @@ CS.RUN lda #C.SPACE
.4 sta OptionIdx
jsr CS.RUN.NextArg
bcs .97
>SYSCALL atoi
bcs .97
tax
bne .97
tya
ldx OptionIdx
sta FieldNum-1,x
@ -118,6 +120,7 @@ CS.RUN lda #C.SPACE
.8 >LDYAI 256
>SYSCALL GetMem
bcs .9
>STYA ZPBufPtr
stx hBuf
lda ArgIndex
@ -309,5 +312,5 @@ DS.START
DS.END .ED
*--------------------------------------
MAN
SAVE USR/SRC/BIN/CUT.S
SAVE usr/src/bin/cut.s
ASM

View File

@ -5,11 +5,11 @@ NEW
.OR $2000
.TF bin/grep
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/KERNEL.I
.INB INC/MLI.I
.INB INC/MLI.E.I
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/kernel.i
.INB inc/mli.i
.INB inc/mli.e.i
*--------------------------------------
.DUMMY
.OR ZPBIN
@ -251,5 +251,5 @@ DS.START
DS.END .ED
*--------------------------------------
MAN
SAVE USR/SRC/BIN/GREP.S
SAVE usr/src/bin/grep.s
ASM

View File

@ -5,11 +5,8 @@ NEW
.OR $2000
.TF bin/term
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/ETH.I
.INB INC/LIBTCPIP.I
.INB INC/NET.TELNET.I
.INB inc/macros.i
.INB inc/a2osx.i
*--------------------------------------
TIMEOUT.MAX .EQ 200 20 sec.
BUFSIZE .EQ 256
@ -135,8 +132,10 @@ CS.RUN.LOOP >SLEEP
*--------------------------------------
CS.DOEVENT lda (pEvent)
bpl .9 is it a TIMER event?
lda TimeOut
beq .9
dec TimeOut
.9 sec do not discard TIMER event
rts
@ -165,5 +164,5 @@ DS.END
.ED
*--------------------------------------
MAN
SAVE USR/SRC/BIN/TERM.S
SAVE usr/src/bin/term.s
ASM

View File

@ -5,11 +5,11 @@ NEW
.OR $2000
.TF bin/wc
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/KERNEL.I
.INB INC/MLI.I
.INB INC/MLI.E.I
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/kernel.i
.INB inc/mli.i
.INB inc/mli.e.i
*--------------------------------------
X.ENTER.SUBDIR .EQ 0
X.COPY.TO.DEST .EQ 0
@ -61,12 +61,8 @@ CS.START cld
.DA CS.QUIT
L.MSG.USAGE .DA MSG.USAGE
L.MSG.ERR .DA MSG.ERR
L.MSG.FILE1 .DA MSG.FILE1
L.MSG.FILE2 .DA MSG.FILE2
L.MSG.FILE3 .DA MSG.FILE3
L.MSG.TOTAL1 .DA MSG.TOTAL1
L.MSG.TOTAL2 .DA MSG.TOTAL2
L.MSG.TOTAL3 .DA MSG.TOTAL3
L.MSG.LONG .DA MSG.LONG
L.MSG.TOTAL .DA MSG.TOTAL
.DA 0
*--------------------------------------
CS.INIT clc
@ -88,15 +84,25 @@ CS.RUN >INC.G ArgIndex
lda #E.SYN
sec
rts
*--------------------------------------
.4 >LDA.G hSrcBasePath
bne .9
>LDYA ZPPtr1
jsr InitSrcDirYA
bcc CS.RUN
.99 rts
*--------------------------------------
.5 lda bChar
ora bLine
ora bWord
bne .51
lda #$ff
sta bChar
sta bLine
sta bWord
.5 >LDA.G hSrcBasePath
.51 >LDA.G hSrcBasePath
bne .6
ldy #S.PS.hStdIn
@ -216,12 +222,15 @@ CS.RUN.PIPE >LDYAI 256
*--------------------------------------
CS.RUN.DIR lda bRecurse
bpl .8
lda (ZPFileName)
cmp #'.'
beq .8
>LDYA ZPFileName
jsr EnterSubDirYA
jmp CS.RUN.CheckErr
.8 clc
rts
*--------------------------------------
@ -374,15 +383,19 @@ CS.RUN.IncFLine phy
bra CS.RUN.IncF
CS.RUN.IncFWord phy
ldy #fWordCount
ldx #4
CS.RUN.IncF lda (pData),y
inc
sta (pData),y
bne .8
iny
dex
bne CS.RUN.IncF
.8 ply
rts
*--------------------------------------
@ -391,6 +404,7 @@ CS.RUN.AddFstat2Tstat
>PUSHL.G tWordCount
>FPU ADD32
>PULLL.G tWordCount
>PUSHL.G fLineCount
>PUSHL.G tLineCount
>FPU ADD32
@ -403,105 +417,94 @@ CS.RUN.AddFstat2Tstat
rts
*--------------------------------------
CS.RUN.PrintFstat
>PUSHW ZPRelPath
ldx #0
bit bWord
bpl .1
>PUSHW L.MSG.LONG
>PUSHL.G fWordCount
inx
>PUSHBI 4
>SYSCALL PrintF
bcs .9
.1 bit bLine
bpl .2
>PUSHW L.MSG.LONG
>PUSHL.G fLineCount
inx
>PUSHBI 4
>SYSCALL PrintF
bcs .9
.2 bit bChar
bpl .3
>PUSHW L.MSG.LONG
>PUSHL.G fCharCount
inx
.3 txa
beq .4
asl
tax
asl
* clc
adc #2
>PUSHA
>LDYA L.MSG.FILE1-2,x
>PUSHBI 4
>SYSCALL PrintF
rts
bcs .9
.4 >PUSHL.G fWordCount
>PUSHL.G fLineCount
>PUSHL.G fCharCount
>PUSHBI 14
>LDYA L.MSG.FILE3
>SYSCALL PrintF
.3 >LDYA ZPRelPath
>SYSCALL PutS
.9
CS.RUN.PrintFstat.RTS
rts
*--------------------------------------
CS.RUN.PrintTstat
clc
lda bTotal
bpl .8
ldx #0
bpl CS.RUN.PrintFstat.RTS
bit bWord
bpl .1
>PUSHW L.MSG.LONG
>PUSHL.G tWordCount
inx
>PUSHBI 4
>SYSCALL PrintF
bcs .9
.1 bit bLine
bpl .2
>PUSHW L.MSG.LONG
>PUSHL.G tLineCount
inx
>PUSHBI 4
>SYSCALL PrintF
bcs .9
.2 bit bChar
bpl .3
>PUSHW L.MSG.LONG
>PUSHL.G tCharCount
inx
.3 txa
beq .4
asl
tax
asl
>PUSHA
>LDYA L.MSG.TOTAL1-2,x
>PUSHBI 4
>SYSCALL PrintF
.8 rts
.4 >PUSHL.G tWordCount
>PUSHL.G tLineCount
>PUSHL.G tCharCount
>PUSHBI 12
>LDYA L.MSG.TOTAL3
>SYSCALL PrintF
rts
bcs .9
.3 >LDYA L.MSG.TOTAL
>SYSCALL PutS
.9 rts
*--------------------------------------
CS.DOEVENT sec
rts
*--------------------------------------
CS.QUIT jsr LeaveSubDir
bcc CS.QUIT
>LDA.G hFilter
beq .1
>SYSCALL FreeMem
.1 >LDA.G hSrcFullPath
beq .2
>SYSCALL FreeMem
.2 >LDA.G hMem
beq .8
>SYSCALL FreeMem
.8 clc
rts
*--------------------------------------
@ -517,13 +520,14 @@ CS.RUN.CheckOpt ldy #1
sec
rts
.3 ldy OptionVars,x
lda #$ff
sta 0,y
clc
rts
*--------------------------------------
.INB USR/SRC/BIN/X.FILEENUM.S
.INB usr/src/bin/x.fileenum.s
*--------------------------------------
CS.END
*--------------------------------------
@ -538,12 +542,8 @@ MSG.USAGE .AS "Usage : WC File(s) (*,? wildcards allowed)\r\n"
.AS " -L : Print the LINE counts\r\n"
.AZ " -W : Print the WORD counts\r\n"
MSG.ERR .AZ "[%h]\r\n"
MSG.FILE3 .AS "%10L "
MSG.FILE2 .AS "%10L "
MSG.FILE1 .AZ "%10L %s\r\n"
MSG.TOTAL3 .AS "%10L "
MSG.TOTAL2 .AS "%10L "
MSG.TOTAL1 .AZ "%10L (total)\r\n"
MSG.LONG .AZ "%10L "
MSG.TOTAL .AZ "(total)"
*--------------------------------------
.DUMMY
.OR 0
@ -564,7 +564,7 @@ hSrcFullPath .BS 1
hFile .BS 1
hMem .BS 1
.INB USR/SRC/BIN/X.FILEENUM.G
.INB usr/src/bin/x.fileenum.g
DS.END
.ED

View File

@ -334,9 +334,9 @@ BB.Read lda BB.HdrTrk get track we're on
bcs seekend ALWAYS
*--------------------------------------
BB.AllPhaseOff ldx slotz
bit IO.D2.Ph2Off,x
bit IO.D2.Ph0Off,x
bit IO.D2.Ph3Off,x
bit IO.D2.Ph2Off,x
bit IO.D2.Ph1Off,x
rts
*--------------------------------------

View File

@ -64,9 +64,9 @@ D2MoveHead >PULLB MoveTo
jsr D2.Wait100msA Trash X
*--------------------------------------
D2.AllPhaseOff ldx Slotn0
bit IO.D2.Ph2Off,x
bit IO.D2.Ph0Off,x
bit IO.D2.Ph3Off,x
bit IO.D2.Ph2Off,x
bit IO.D2.Ph1Off,x
D2.AllPahseOff.8
clc

View File

@ -776,10 +776,11 @@ XRW.Seek ldx XRW.UnitIndex
jsr XRW.Wait100msA Trash X
*--------------------------------------
XRW.AllPhaseOff ldx A2L
bit IO.D2.Ph2Off,x
bit IO.D2.Ph0Off,x
bit IO.D2.Ph3Off,x
bit IO.D2.Ph2Off,x
bit IO.D2.Ph1Off,x
XRW.AllPhaseOff.8
rts
*--------------------------------------