Kernel 0.9.1 : Modified string API

This commit is contained in:
Rémy GIBERT 2018-01-15 16:51:44 +00:00
parent 0932474116
commit 5c55e240f2
9 changed files with 146 additions and 84 deletions

View File

@ -54,6 +54,16 @@ And return, if found, the full path to it.
## OUT:
+ Y,A = S.DSTAT
# K.DevIOCTL
## IN:
+ PUSHB = DevID
+ PUSHB = Operation
+ PUSHW = Param Block
## OUT:
+ Y,A = ...
# OpenDir.YA
## In:
@ -281,6 +291,14 @@ Create a new copy of this C-String
+ CS : error
+ A = SYS error code
# GetMemStat.YA
## In:
+ Y,A = Ptr to 24 bytes buffer
## Out:
+ Buffer filled with memory stats
# SListNew
## In:
@ -316,18 +334,6 @@ Create a new copy of this C-String
## Out:
+ A=hMem
# NewStkObj.YA
## In:
+ Y,A = Size Requested
## Out:
+ CC : success
+ YA = PTR to Mem (Uninitialised)
* X = hMem
+ CS :
+ A = EC
# LoadStkObj
Load a file in AUX memory (Stock Objects)
@ -341,14 +347,17 @@ Load a file in AUX memory (Stock Objects)
+ Y,A = File Length
+ X = hMem of Loaded Object in AUX mem
# GetStkObj.A
# NewStkObj.YA
## In:
+ A = hMem
## In:
+ Y,A = Size Requested
## Out:
+ Y,A = PTR to MemBlock (AUX Mem)
+ (X unmodified)
+ CC : success
+ YA = PTR to Mem (Uninitialised)
* X = hMem
+ CS :
+ A = EC
# FreeStkObj.A
@ -359,14 +368,6 @@ Load a file in AUX memory (Stock Objects)
+ none.
+ (X,Y unmodified)
# GetMemStat.YA
## In:
+ Y,A = Ptr to 24 bytes buffer
## Out:
+ Buffer filled with memory stats
# ExecPSNewEnv.YA
# ExecPS.YA (Blocking Parent PID)
@ -477,25 +478,6 @@ Write String to StdOut
## Out:
+ CC = success
# FGetS
Read String From Node
## In:
+ PUSHW : CPtr
+ PUSHB : hFILE
## Out:
+ CC = success
# GetS.YA
Read String From StdIn
## In:
+ Y,A : CPtr
## Out:
+ CC = success
# FOpen
Open a file
@ -789,6 +771,27 @@ Convert string to UPPERCASE/lowercase
## Out:
+ Uppercased/lowercased String in Buffer
# StrCmp
Compare 2 strings
## In:
+ PUSHW = Ptr to String1 (CSTR)
+ PUSHW = Ptr to String2 (CSTR)
## Out:
+ DST = SRC
# StrICmp
Compare 2 strings
## In:
+ PUSHW = Ptr to String1 (CSTR)
+ PUSHW = Ptr to String2 (CSTR)
## Out:
+ CC, Y,A=0
+ CS, Y,A > 0 or < 0
# Time.YA
+ Get System Time in Buffer

Binary file not shown.

Binary file not shown.

View File

@ -153,13 +153,13 @@ SYS.StrCat .EQ $84
SYS.StrMatch .EQ $86
SYS.StrUpr.YA .EQ $88
SYS.StrLwr.YA .EQ $8A
SYS.StrFTime .EQ $8C
* .EQ $8E
SYS.StrCmp .EQ $8C
SYS.StrICmp .EQ $8E
SYS.Time.YA .EQ $90
SYS.CTime2Time .EQ $92
SYS.PTime2Time .EQ $94
* .EQ $96
SYS.StrFTime .EQ $96
SYS.LoadLib.YA .EQ $98
SYS.UnloadLib.A .EQ $9A

View File

@ -59,7 +59,7 @@ DNS.REQUEST lda hDNSSocket1
sec
rts
.10 jsr DNS.PSTR2DNS
.10 jsr DNS.CSTR2DNS
ldx #0
ldy #DNS.MSG.NAME-DNS.MSG
@ -196,23 +196,10 @@ DNS.FIND.BY.NAME
ldy #S.DNSCACHE.hNAME
lda (ZPCachePtr),y
>SYSCALL GetMemPtr.A
bcs *
>STYA ZPTmpPtr1
lda (ZPPtrDNS)
cmp (ZPTmpPtr1)
bne .6
tay
.2 lda (ZPPtrDNS),y
cmp (ZPTmpPtr1),y
bne .6
dey
bne .2
clc
rts
>PUSHYA
>PUSHW ZPPtrDNS
>SYSCALL StrICmp
bcc .8
.6 lda ZPCachePtr
clc
@ -224,7 +211,7 @@ DNS.FIND.BY.NAME
.7 dec TmpOffset
bne .1
sec
rts
.8 rts
*--------------------------------------
DNS.UPDATE.BY.ID
>LDYA L.DNS.CACHE
@ -493,17 +480,18 @@ DNS.DecodeMsg sta hFrameIn
>SYSCALL FreeMem.A
rts
*--------------------------------------
DNS.PSTR2DNS lda (ZPPtrDNS)
DNS.CSTR2DNS lda (ZPPtrDNS)
beq .9
cmp #K.DNS.MAXLEN-1
>LDYA ZPPtrDNS
>SYSCALL StrLen.YA
tax
bne .9
cpy #K.DNS.MAXLEN-1
bcs .9
tay
inc
sta DNS.HostNameLen
lda #0 Ending 0
sta DNS.HostName+1,y

View File

@ -274,7 +274,6 @@ DevFlags .BS 1
DYNPORT.LAST .DA K.DYNPORT.START
hDNSSocket1 .BS 1
hDNSSocket2 .BS 1
DNS.HostNameLen .BS 1
DNS.HostName .BS K.DNS.MAXLEN+1
DNS.TmpCache .BS S.DNSCACHE
ARP.TmpCache .BS S.ARP

View File

@ -193,12 +193,12 @@ note : '$VAR' does NOT expand Variable
| SSC.DRV | Working | Apple "Super Serial Card" Driver | 0.9.1 |
| SSC.I.DRV | Working | Apple "Super Serial Card" Driver (IRQ enabled) | 0.9.1 |
| PIC.DRV | In Progress | Apple "Parallel Interface Card" Driver, renamed from PPIC.DRV | 0.9 |
| Mouse.DRV | Working | Apple Mouse Card,//c Mouse Port | 0.9 |
| DHGR.DRV | In Progress | except bitblt... | 0.9 |
| Mouse.DRV | Working | Apple Mouse Card,//c Mouse Port | 0.9.1 |
| DHGR.DRV | Working | 560x192 Mono/16 colors Mixed-Mode support | 0.9.1 |
| ---- | ------ | ------- | ----- |
| LanCeGS.DRV | Working | | 0.9 |
| Uthernet.DRV | Working | | 0.9 |
| Uthernet2.DRV | Working | | 0.9 |
| LanCeGS.DRV | Working | | 0.9.1 |
| Uthernet.DRV | Working | | 0.9.1 |
| Uthernet2.DRV | Working | | 0.9.1 |
| Uther2.AI.DRV | In Progress | With ARP/IP Offloading | 0.9 |
## BIN,External Shell commands:
@ -234,7 +234,7 @@ note : '$VAR' does NOT expand Variable
| CHGRP | In Progress | -C : Continue On Error | 0.9 |
| | | -R : Recurse subdirectories | |
| FORMAT | In Progress | -L : Low-Level Format | 0.9.1 |
| EDIT | Working | still missing : find/replace | 0.9 |
| EDIT | Working | still missing : find/replace | 0.9.1 |
| NSCUTIL | Working | Tool for setting time in NSC/DL1216E | 0.9 |
| ---- | ------ | ------- | ----- |
| ARP | Working | dump ARP cache, setup a static ARP entry | 0.9 |
@ -246,7 +246,7 @@ note : '$VAR' does NOT expand Variable
## BIN,External DEV Shell commands:
| Name | Status | Comment | K.Ver |
| ---- | ------ | ------- | ----- |
| ASM | In Progress | S-C MASM based multi CPU assembler | 0.9 |
| ASM | In Progress | S-C MASM based multi CPU assembler | 0.9.1 |
| MEMDUMP | Working | | 0.9.1 |
| ---- | ------ | ------- | ----- |
| RPCDUMP | Working | tool based on UDP socket API, renamed from RPCINFO | 0.9 |

View File

@ -86,13 +86,13 @@ K.SYSCALL.JMP .DA 0 $00
.DA K.StrMatch
.DA K.StrUpr.YA
.DA K.StrLwr.YA
.DA K.StrFTime
.DA 0
.DA K.StrCmp
.DA K.StrICmp
.DA K.Time.YA $90
.DA K.CTime2Time
.DA K.PTime2Time
.DA 0
.DA K.StrFTime
.DA K.LoadLib.YA
.DA K.UnloadLib.A
.DA K.LoadDrv.YA

View File

@ -176,6 +176,78 @@ K.StrLwr.YA ldx #2
rts
*--------------------------------------
.9 .AS "azAZ"
*/--------------------------------------
* # StrCmp
* Compare 2 strings
* ## In:
* PUSHW = Ptr to String1 (CSTR)
* PUSHW = Ptr to String2 (CSTR)
* ## Out:
* DST = SRC
*\--------------------------------------
K.StrCmp sec
.HS 90 BCC
*/--------------------------------------
* # StrICmp
* Compare 2 strings
* ## In:
* PUSHW = Ptr to String1 (CSTR)
* PUSHW = Ptr to String2 (CSTR)
* ## Out:
* CC, Y,A=0
* CS, Y,A > 0 or < 0
*\--------------------------------------
K.StrICmp clc
jsr PullP1P2
ldy #0
.1 lda (ZPPtr1),y
beq .7
jsr K.StrICmp.toUpper
sta .2
lda (ZPPtr2),y
beq .9
jsr K.StrICmp.toUpper
.2 eor #$ff SELF MODIFIED
bne .9
iny
bne .1
inc ZPPtr1+1
inc ZPPtr2+1
bra .1
.7 lda (ZPPtr2),y
bne .9
tay
.8 clc
rts
.9 sec
lda (ZPPtr1),y
sbc (ZPPtr2),y
ldy #0
sec
rts
*--------------------------------------
K.StrICmp.toUpper
bcs .9
php
cmp #'a'
bcc .1
cmp #'z'+1
bcs .1
eor #$20
.1 plp
.9 rts
*--------------------------------------
MAN
SAVE /A2OSX.SRC/SYS/KERNEL.S.STRING