diff --git a/.Docs/KERNEL.md b/.Docs/KERNEL.md index 235df151..92a0cfa0 100644 --- a/.Docs/KERNEL.md +++ b/.Docs/KERNEL.md @@ -624,14 +624,20 @@ Rename a file ## Out : -# SScanF +# SScanF.YA Scan a C-String (in progress) ## In: -+ PUSHW PTR to target buffer -+ PUSHW PSTR pattern (ex: "%d.%d.%d.%d") ++ PUSHW PTR to target var ++ ... ++ PUSHW PTR pattern (ex: "%d.%d.%d.%d") + + %i : short int + %d : byte -+ PUSHW PSTR to scan (ex: "192.168.1.5") + + %I : int + + %D : word +* %L : long int +* %U : dword ++ Y,A = PTR to String to scan (ex: "192.168.1.5") ## Out: diff --git a/.Docs/LIBTCPIP.md b/.Docs/LIBTCPIP.md index 414baac2..3f74e2ce 100644 --- a/.Docs/LIBTCPIP.md +++ b/.Docs/LIBTCPIP.md @@ -56,7 +56,7 @@ ## In: + PUSHW = PTR to IP -+ PUSHW = hostname PSTR to Add ++ PUSHW = hostname CSTR to Add # DNS.GetCAche + Return a Ptr to DNS Cache Table diff --git a/.Floppies/A2OSX.BOOT.po b/.Floppies/A2OSX.BOOT.po index 22ef0e6c..58e38177 100644 Binary files a/.Floppies/A2OSX.BOOT.po and b/.Floppies/A2OSX.BOOT.po differ diff --git a/.Floppies/A2OSX.BUILD.po b/.Floppies/A2OSX.BUILD.po index 3085fcf9..a3e89789 100644 Binary files a/.Floppies/A2OSX.BUILD.po and b/.Floppies/A2OSX.BUILD.po differ diff --git a/.Floppies/A2OSX.SRC.po b/.Floppies/A2OSX.SRC.po index e5a0e491..42904d3d 100644 Binary files a/.Floppies/A2OSX.SRC.po and b/.Floppies/A2OSX.SRC.po differ diff --git a/.screen-shots/ScreenShot.GFX.png b/.screen-shots/ScreenShot.GFX.png new file mode 100644 index 00000000..24a79da4 Binary files /dev/null and b/.screen-shots/ScreenShot.GFX.png differ diff --git a/BIN/ARP.S.txt b/BIN/ARP.S.txt index 0658cce5..229a22b5 100644 --- a/BIN/ARP.S.txt +++ b/BIN/ARP.S.txt @@ -35,8 +35,6 @@ CS.START cld .DA CS.QUIT L.LIBTCPIP .DA LIBTCPIP L.SSCANF.IP .DA SSCANF.IP -L.DST.IP .DA DST.IP -L.DST.MAC .DA DST.MAC L.MSG0 .DA MSG0 L.MSG1 .DA MSG1 L.MSG2 .DA MSG2 @@ -58,13 +56,15 @@ CS.RUN ldy #S.PS.ARGC bne .1 jmp CS.RUN.DUMP -.1 >PUSHW L.DST.IP +.1 >PUSHEA.G DST.IP+3 + >PUSHEA.G DST.IP+2 + >PUSHEA.G DST.IP+1 + >PUSHEA.G DST.IP >PUSHW L.SSCANF.IP lda #1 >SYSCALL GetArg.A - >PUSHYA - >SYSCALL SSCANF + >SYSCALL SScanF.YA bcc CS.RUN.QUERY lda #K.E.SYN @@ -73,8 +73,8 @@ CS.RUN ldy #S.PS.ARGC *-------------------------------------- CS.RUN.QUERY jsr Init.Timeout -.1 >PUSHW L.DST.MAC - >PUSHW L.DST.IP +.1 >PUSHEA.G DST.MAC + >PUSHEA.G DST.IP >LIBCALL hLIBTCPIP,LIBTCPIP.ARP.QUERY bcc .2 success, print & exit @@ -88,14 +88,16 @@ CS.RUN.QUERY jsr Init.Timeout beq .8 bra .1 -.2 ldx #5 -.3 >PUSHB DST.MAC,x - dex +.2 ldy #5 + +.3 >PUSHB.G DST.MAC,y + dey bpl .3 - ldx #3 -.4 >PUSHB DST.IP,x - dex + ldy #3 + +.4 >PUSHB.G DST.IP,y + dey bpl .4 >LDYA L.MSG2 @@ -188,9 +190,9 @@ SSCANF.IP .AZ "%d.%d.%d.%d" MSG0 .AZ "STS TTL MAC Address IP Address\r\n" MSG1 .AZ "$%h %5D %h:%h:%h:%h:%h:%h %d.%d.%d.%d\r\n" MSG2 .AZ "%d.%d.%d.%d is at %h:%h:%h:%h:%h:%h\r\n" +hLIBTCPIP .BS 1 *-------------------------------------- DS.START -hLIBTCPIP .BS 1 DST.IP .BS 4 DST.MAC .BS 6 TimeOut .BS 1 diff --git a/BIN/DNSINFO.S.txt b/BIN/DNSINFO.S.txt index 641e9604..916d3346 100644 --- a/BIN/DNSINFO.S.txt +++ b/BIN/DNSINFO.S.txt @@ -34,7 +34,6 @@ CS.START cld .DA CS.QUIT L.LIBTCPIP .DA LIBTCPIP L.SSCANF.IP .DA SSCANF.IP -L.IP .DA IP L.MSG0 .DA MSG0 L.MSG1 .DA MSG1 .DA 0 @@ -51,20 +50,25 @@ CS.INIT >LDYA L.LIBTCPIP *-------------------------------------- CS.RUN ldy #S.PS.ARGC lda (pPs),y - beq CS.RUN.DUMP + bne CS.RUN.ADD + jmp CS.RUN.DUMP -CS.RUN.ADD cmp #3 - bne .9 +CS.RUN.ADD cmp #2 + beq .1 + jmp .9 - >PUSHW L.IP +.1 >PUSHEA.G DST.IP+3 + >PUSHEA.G DST.IP+2 + >PUSHEA.G DST.IP+1 + >PUSHEA.G DST.IP >PUSHW L.SSCANF.IP - lda #3 + lda #1 >SYSCALL GetArg.A - >PUSHYA - >SYSCALL SSCANF + + >SYSCALL SScanF.YA bcs .9 - >PUSHW L.IP + >PUSHEA.G DST.IP lda #2 >SYSCALL GetArg.A >PUSHYA @@ -85,7 +89,7 @@ CS.RUN.DUMP >LIBCALL hLIBTCPIP,LIBTCPIP.DNS.GetCache >SYSCALL PrintF.YA lda #K.DNSCACHE.SIZE - sta EntryCount + >STA.G EntryCount .1 lda (ZPPTR1) beq .2 @@ -126,7 +130,7 @@ CS.RUN.DUMP >LIBCALL hLIBTCPIP,LIBTCPIP.DNS.GetCache bcc .3 inc ZPPTR1+1 -.3 dec EntryCount +.3 >DEC.G EntryCount bne .1 .8 lda #0 tell TSKMGR that all done ok, but @@ -147,9 +151,12 @@ SSCANF.IP .AZ "%d.%d.%d.%d" MSG0 .AZ "STS TR.ID Hostname IP Address TTL\r\n" MSG1 .AZ "$%h $%H %32s %03d.%03d.%03d.%03d %u\r\n" hLIBTCPIP .BS 1 - -IP .BS 4 +*-------------------------------------- +DS.START +DST.IP .BS 4 EntryCount .BS 1 +DS.END +*-------------------------------------- MAN SAVE /A2OSX.SRC/BIN/DNSINFO.S ASM diff --git a/INC/A2osX.I.txt b/INC/A2osX.I.txt index 088cfb62..f50060b1 100644 --- a/INC/A2osX.I.txt +++ b/INC/A2osX.I.txt @@ -120,7 +120,7 @@ SYS.GetDevStatus.A .EQ $4C SYS.IOCTL .EQ $4E * .EQ $50 -SYS.SScanF .EQ $52 +SYS.SScanF.YA .EQ $52 * .EQ $54 * .EQ $56 SYS.PrintF.YA .EQ $58 diff --git a/LIB/LIBTCPIP.S.DNS.txt b/LIB/LIBTCPIP.S.DNS.txt index ef1c3da7..85191188 100644 --- a/LIB/LIBTCPIP.S.DNS.txt +++ b/LIB/LIBTCPIP.S.DNS.txt @@ -127,7 +127,7 @@ DNS.REQUEST lda hDNSSocket1 * Add a static DNS record * ## In: * PUSHW = PTR to IP -* PUSHW = hostname PSTR to Add +* PUSHW = hostname CSTR to Add *\-------------------------------------- DNS.Add >PULLW ZPPtrDNS Get host string >PULLW ZPPtrIP Get host IP address diff --git a/README.md b/README.md index 06c29347..8abbaf31 100644 --- a/README.md +++ b/README.md @@ -125,10 +125,14 @@ Kernel Configuration Utility... ![](./.screen-shots/ScreenShot.KCONFIG.png) -Color ANSI/VT100 Support !!! +Color ANSI/VT100 Support... ![](./.screen-shots/PuTTY.png) +DHGR Mixed-Mode Graphic primitives.... + +![](./.screen-shots/ScreenShot.GFX.png) + ## General Information: Kernel API is confined in Aux LC Bank 1 & 2 to leave enough room at $EOOO for Drivers. diff --git a/SYS/KERNEL.S.JMP.txt b/SYS/KERNEL.S.JMP.txt index e725e4c4..aeca97f9 100644 --- a/SYS/KERNEL.S.JMP.txt +++ b/SYS/KERNEL.S.JMP.txt @@ -52,7 +52,7 @@ K.SYSCALL.JMP .DA 0 $00 .DA K.IOCTL .DA 0 $50 - .DA K.SScanF + .DA K.SScanF.YA .DA 0 .DA 0 .DA K.PrintF.YA diff --git a/SYS/KERNEL.S.STDIO.txt b/SYS/KERNEL.S.STDIO.txt index a0bc446c..b9a3ad1e 100644 --- a/SYS/KERNEL.S.STDIO.txt +++ b/SYS/KERNEL.S.STDIO.txt @@ -626,101 +626,109 @@ K.PrintF.PadC .BS 1 HEXBUF .EQ FAC BCDBUF .EQ ARG */-------------------------------------- -* # SScanF +* # SScanF.YA * Scan a C-String (in progress) * ## In: -* PUSHW PTR to target buffer +* PUSHW PTR to target var +* ... * PUSHW PTR pattern (ex: "%d.%d.%d.%d") +* %i : short int * %d : byte -* PUSHW PTR to String to scan (ex: "192.168.1.5") +* %I : int +* %D : word +* %L : long int +* %U : dword +* Y,A = PTR to String to scan (ex: "192.168.1.5") * ## Out: *\-------------------------------------- -K.SScanF jsr MEM.PullP1P2P3 +K.SScanF.YA >STYA ZPPtr2 String to Scan + >PULLW ZPPtr1 Pattern - ldy #0 Y = PTR in pattern - - lda (ZPPtr1) - beq .9 - tax X = COUNT to scan +.1 lda (ZPPtr1) End Of Pattern? + beq .8 + inc ZPPtr1 - bne .1 + bne .11 inc ZPPtr1+1 -.1 txa End Of String? - beq .8 - tya - cmp (ZPPtr2) End of pattern? - beq .8 - iny - lda (ZPPtr2),y - cmp #'%' Escape? +.11 cmp #'%' Escape? beq .2 - cmp (ZPPtr1) Same char? + + cmp (ZPPtr2) Same char in string? bne .9 - jsr K.SScanF.IncPtr1 + + inc ZPPtr2 bne .1 - clc + inc ZPPtr2+1 + bra .1 + +.2 lda (ZPPtr1) Get specifier after % + beq .9 unexpected End of pattern after "%" ? + + inc ZPPtr1 + bne .21 + inc ZPPtr1+1 + +.21 ldx #K.SScanFJMP-K.SScanFTBL-2 + +.3 cmp K.SScanFTBL,x + beq .4 + dex + dex + bpl .3 + +.9 lda #MLI.E.EOF + sec rts -.2 tya - cmp (ZPPtr2) unexpected End of pattern after "%" ? - beq .9 - - iny - lda (ZPPtr2),y - cmp #'d' BYTE ? - bne .3 +.4 jsr .5 -* stz ASCBUF -.20 lda (ZPPtr1) - jsr MEM.IsDigit - bcs .21 - phx -* inc ASCBUF -* ldx ASCBUF -* sta ASCBUF,x - plx - jsr K.SScanF.IncPtr1 - bne .20 end of string ? - -.21 + tya + clc + adc ZPPtr2 + sta ZPPtr2 + bcc .1 + inc ZPPtr2+1 - -* jsr DEC2HEX AToF MIGRATION - - bra * - - - lda HEXBUF - sta (ZPPtr3) - inc ZPPtr3 - bne .1 - inc ZPPtr3+1 - bra .1 - -.3 cmp #'D' WORD ? - bne .4 - - bra .1 - -.4 cmp #'s' STRING ? - bne .9 - bra .1 .8 clc rts - -.9 sec - rts *-------------------------------------- -K.SScanF.IncPtr1 - dex - beq .1 - inc ZPPtr1 - bne .1 - inc ZPPtr1+1 never Zero -.1 rts +.5 >PULLW ZPPtr3 get VAR Ptr + + lda K.SScanFTBL+1,x Get VAR Byte count + jmp (K.SScanFJMP,x) +*-------------------------------------- +K.SScanFTBL .DA #'i,#1,#'d,#1,#'I,#2,#'D,#2,#'l,#4,#'u,#4 +K.SScanFJMP .DA K.SScanF.I + .DA K.SScanF.D + .DA K.SScanF.II + .DA K.SScanF.DD + .DA K.SScanF.L + .DA K.SScanF.U +*-------------------------------------- +K.SScanF.I +K.SScanF.D +K.SScanF.II +K.SScanF.DD +K.SScanF.L +K.SScanF.U pha Save Byte count + + jsr STDLIB.Dec2Hex + + pla + phy + tay + +.1 lda STDLIB.32-1,y + dey + sta (ZPPtr3),y + bpl .1 + + ply + +.9 rts */-------------------------------------- * # PrintF.YA/SPrintF.YA/FPrintF.YA * Prints C-Style String diff --git a/SYS/KERNEL.S.STDLIB.txt b/SYS/KERNEL.S.STDLIB.txt index 6abb69e8..427b7f6e 100644 --- a/SYS/KERNEL.S.STDLIB.txt +++ b/SYS/KERNEL.S.STDLIB.txt @@ -81,6 +81,9 @@ K.StrToUL.rts rts * PUSHW PTR to target buffer DWORD * ## Out: *\-------------------------------------- +*STDLIB.32 .BS 4 32 bits max +STDLIB.32 .EQ FAC 32 bits max +*-------------------------------------- K.AToL jsr MEM.PullP1P2 C-String in Ptr2, Dst buffer in Ptr1 lda #10 base 10 @@ -119,7 +122,7 @@ K.AToI.YA >STYA ZPPtr2 >LDYA STDLIB.32 .9 rts *-------------------------------------- -* Convert ZPPtr1 to STDLIB.32 +* Convert ZPPtr2 to STDLIB.32 *-------------------------------------- STDLIB.Dec2Hex jsr STDLIB.32.Clear @@ -132,16 +135,13 @@ STDLIB.Dec2Hex jsr STDLIB.32.Clear jsr MEM.IsDigit bcs .8 - phy Save Y, pointing to next char - jsr STDLIB.32.T10 - - ply - bcs .9 lda (ZPPtr2),y and #$0F + +* clc adc STDLIB.32 sta STDLIB.32 @@ -165,12 +165,14 @@ STDLIB.32.T10 ldx #3 dex bpl .1 - jsr STDLIB.32.ROL STDLIB.32 * 2 -> STDLIB.32 + jsr .7 STDLIB.32 * 2 -> STDLIB.32 bcs .9 overflow!!! - jsr STDLIB.32.ROL STDLIB.32 * 4 -> STDLIB.32 + jsr .7 STDLIB.32 * 4 -> STDLIB.32 bcs .9 overflow!!! + phy Save Y, pointing to next char + ldx #0 ldy #4 @@ -183,9 +185,16 @@ STDLIB.32.T10 ldx #3 dey bne .2 + ply + bcs .99 overflow!!! - jsr STDLIB.32.ROL STDLIB.32 * 10 -> STDLIB.32 +* STDLIB.32 * 10 -> STDLIB.32 + +.7 asl STDLIB.32 + rol STDLIB.32+1 + rol STDLIB.32+2 + rol STDLIB.32+3 rts if CS, overflow!!! .9 pla discard saved STDLIB.32 @@ -195,11 +204,7 @@ STDLIB.32.T10 ldx #3 .99 rts *-------------------------------------- -STDLIB.32.ROL asl STDLIB.32 - rol STDLIB.32+1 - rol STDLIB.32+2 - rol STDLIB.32+3 - rts + *-------------------------------------- STDLIB.32.Clear ldx #3 @@ -207,8 +212,6 @@ STDLIB.32.Clear ldx #3 dex bpl .1 rts -*-------------------------------------- -STDLIB.32 .BS 4 32 bits max */-------------------------------------- * # RealPath.YA * Return the canonicalized absolute pathname