diff --git a/.Docs/KERNEL.md b/.Docs/KERNEL.md index 9b040df0..db47472e 100644 --- a/.Docs/KERNEL.md +++ b/.Docs/KERNEL.md @@ -126,9 +126,9 @@ Create a hDEV ## ASM `>LDYA dirpath` -`>SYSCALL opendir` +`>SYSCALL opendir` -## RETURN VALUE +## RETURN VALUE CC : success A = hDIR CS : error @@ -144,7 +144,7 @@ Create a hDEV `lda hDIR` `>SYSCALL readdir` -## RETURN VALUE +## RETURN VALUE CC : success X = hDIRENT Y,A = PTR to S.DIRENT @@ -162,7 +162,7 @@ Create a hDEV `>SYSCALL closedir` ## RETURN VALUE - none, always succeed. + none, always succeed. # SetEnv Change or add an environment variable @@ -559,6 +559,18 @@ CS : not found ## RETURN VALUE +# OpenSession + +## C +`short int hSID opensession(const char *name, const char *passwd);` + +## ASM +`>PUSHW name` +`>PUSHW passwd` +`>SYSCALL OpenSession` + +## RETURN VALUE + # GetPWName ## C @@ -586,7 +598,7 @@ CS : not found # PutPW ## C -`int putpw( S.PW* passwd );` +`int putpw(S.PW* passwd);` ## ASM `>PUSHW passwd` @@ -605,18 +617,6 @@ CS : not found ## RETURN VALUE -# OpenSession - -## C -`short int hSID opensession(const char *name, const char *passwd);` - -## ASM -`>PUSHW name` -`>PUSHW passwd` -`>SYSCALL OpenSession` - -## RETURN VALUE - # CloseSession ## C @@ -903,6 +903,21 @@ Get char from Node `lda stream` `>SYSCALL getc` +## RETURN VALUE + CC = success + A = char + +# ungetc +push byte back into input stream + +## C +`int ungetc(short int c, hFILE stream); + +## ASM +`>PUSHB c` +`>PUSHB stream` +`>SYSCALL ungetc` + ## RETURN VALUE CC = success A = char diff --git a/.Docs/LIBBLKDEV.md b/.Docs/LIBBLKDEV.md index d7c1ccbd..25355f49 100644 --- a/.Docs/LIBBLKDEV.md +++ b/.Docs/LIBBLKDEV.md @@ -3,9 +3,18 @@ ## Copyright Copyright 2015 - 2020, Remy Gibert and the A2osX contributors. +# D2TrkRead16s +Write a track (16 sectors) + PUSHB = DSSS0000 + PUSHB = TrackNum * 4 : 0->136+ + PUSHW = Ptr to 16*256 buffer + +## RETURN VALUE + CC : success, A = VolNum + CS : A = Error + # D2TrkWrite16s Write a track (16 sectors) -**In:** PUSHB = DSSS0000 PUSHB = TrackNum * 4 : 0->136+ PUSHW = Ptr to 16*256 buffer @@ -13,7 +22,6 @@ Write a track (16 sectors) ## RETURN VALUE CC : success CS : A = Error - A=0, currently starting/seeking... # D2TrkWriteNIB Write a track (NIBBLE) diff --git a/.Floppies/A2OSX.BUILD.po b/.Floppies/A2OSX.BUILD.po index 652cc1a2..7bc08d97 100644 Binary files a/.Floppies/A2OSX.BUILD.po and b/.Floppies/A2OSX.BUILD.po differ diff --git a/BIN/LS.S.txt b/BIN/LS.S.txt index 298a6b42..f431522e 100644 --- a/BIN/LS.S.txt +++ b/BIN/LS.S.txt @@ -7,6 +7,7 @@ NEW *-------------------------------------- .INB inc/macros.i .INB inc/a2osx.i + .INB inc/kernel.i .INB inc/mli.i .INB inc/mli.e.i *-------------------------------------- @@ -25,6 +26,10 @@ ZPFileName .BS 2 ZPFileStat .BS 2 ZPPW .BS 2 + +bToDev .BS 1 +hLineBuf .BS 1 +ZPLineBuf .BS 2 ZS.END .ED *-------------------------------------- @@ -78,10 +83,12 @@ CS.RUN .1 >INC.G ArgCount >SYSCALL ArgV bcs .6 + >STYA ZPPtr1 lda (ZPPtr1) cmp #'-' bne .4 + ldy #1 lda (ZPPtr1),y @@ -124,6 +131,25 @@ CS.RUN >STYA ZPPW txa >STA.G hPW + + >LDYAI 256 + >SYSCALL GetMem + bcs .9 + >STYA ZPLineBuf + stx hLineBuf + + ldy #S.PS.hStdOut + lda (pPS),y + tax + lda OF.Table.hFD-1,x + >SYSCALL GetMemPtr + >STYA ZPPtr1 + lda (ZPPtr1) S.FD.T + beq CS.RUN.LOOP S.FD.T.REG + cmp #S.FD.T.PIPE + beq CS.RUN.LOOP + + dec bToDev *-------------------------------------- CS.RUN.LOOP ldy #S.PS.hStdIn lda (pPS),y @@ -222,7 +248,9 @@ CS.RUN.PRINT.REG bcs .9 jmp CS.RUN.UpdateColCnt *-------------------------------------- -.1 >PUSHW L.MSG.REGEXT +.1 +* >PUSHW ZPLineBuf + >PUSHW L.MSG.REGEXT jsr Mod2CSTR (2) @@ -255,7 +283,10 @@ CS.RUN.PRINT.REG >PUSHBI 20 >SYSCALL PrintF - + bcs .9 + + jmp CS.RUN.NewLine.1 + .9 rts *-------------------------------------- CS.RUN.PRINT.DIR @@ -318,7 +349,9 @@ CS.RUN.PRINT.DIR >PUSHW ZPFileName >PUSHBI 12 >SYSCALL PrintF - + bcs .90 + + jsr CS.RUN.NewLine.1 bcs .90 .5 >LDA.G bRecurse @@ -413,6 +446,9 @@ CS.RUN.PRINT.BDEV >SYSCALL PrintF bcs .90 + + jsr CS.RUN.NewLine.1 + bcs .90 ldy #bRecurse lda (pData),y @@ -592,10 +628,18 @@ CS.RUN.UpdateColCnt CS.RUN.NewLine >LDA.G ColCount beq CS.RUN.NewLine.8 CS.RUN.NewLine.1 + bit bToDev + bpl CS.RUN.NewLine.CR + >PUSHW L.MSG.CRLF >PUSHBI 0 >SYSCALL PrintF rts + +CS.RUN.NewLine.CR + lda #C.CR + >SYSCALL putchar + rts CS.RUN.NewLine.8 clc rts @@ -622,6 +666,11 @@ CS.QUIT jsr LeaveSubDir >SYSCALL FreeMem .3 >LDA.G hPW + beq .4 + + >SYSCALL FreeMem + +.4 lda hLineBuf beq .8 >SYSCALL FreeMem @@ -700,7 +749,7 @@ Mod2CSTR ldy #S.STAT.MODE+1 >PUSHEA.G MOD rts *-------------------------------------- - .INB USR/SRC/BIN/X.FILEENUM.S + .INB usr/src/bin/x.fileenum.s *-------------------------------------- CS.END *-------------------------------------- @@ -708,11 +757,11 @@ OptionList .AS "ACFLRacflr" OptionVars .DA #bAllmostAll,#bColumn,#bFullPath,#bLong,#bRecurse,#bAllmostAll,#bColumn,#bFullPath,#bLong,#bRecurse *-------------------------------------- MSG.REG .AZ "%19s" -MSG.REGEXT .AZ "%s %6s %6s %10u %s %s %S %H %s\r\n" +MSG.REGEXT .AZ "%s %6s %6s %10u %s %s %S %H %s" MSG.DIR .AZ "\e[32m%s/\e[0m" -MSG.DIREXT .AZ "%s %6s %6s %s %s