Kernel version 0.9 : LS,CP,RM,MV, bug fix dst path not printed properly

Bug Fix in SHELL, $?,$$....sysvars not printed at all
Generalized use of new MemMgr API Call in all DRV,BIN,SBIN & LIB
This commit is contained in:
Rémy GIBERT 2017-07-06 17:30:40 +02:00
parent 9c954442ad
commit 8702d8c4e1
29 changed files with 114 additions and 150 deletions

View File

@ -492,6 +492,18 @@ And return, if found, the full path to it.
+ CS :
+ A = EC
# GetMem0YA
## In:
+ Y,A = Size Requested
## Out:
+ CC : success
+ YA = PTR to Mem (ZERO Initialised)
* X = hMem
+ CS :
+ A = EC
# GetMemYA
## In:

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -320,9 +320,8 @@ SYM.AddByteGBlock phx
*---------------------------------------
SYM.NewGBlock phx
phy
SYM.NewGBlock2 >PUSHWI 256
>PUSHBI S.MEM.F.INIT0
>SYSCALL GetMem
SYM.NewGBlock2 >LDYAI 256
>SYSCALL GetMem0YA
bcs .9
>STYA ZPBlockPtr

View File

@ -76,8 +76,7 @@ CS.RUN stz K.MLI.PARAMS Sync
>LDYAI 1024
>STYA K.MLI.PARAMS+$10 BufLen
>PUSHBI 0
>SYSCALL GetMem
>SYSCALL GetMemYA
bcs .99
>STYA K.MLI.PARAMS+$12 BufPtr

View File

@ -254,9 +254,8 @@ BUF.SelToClipboard
>SYSCALL FreeMemA
.1 >PUSHW TmpCount
>PUSHB 0
>SYSCALL GetMem
.1 >LDYA TmpCount
>SYSCALL GetMemYA
bcs .9
>STYA ClipboardPtr
@ -454,9 +453,8 @@ BUF.GetNewYA >STYA TmpLen
>SYSCALL GetMemPtrA
>STYA BufPtrBackup
>PUSHW TmpLen
>PUSHBI S.MEM.F.INIT0
>SYSCALL GetMem
>LDYA TmpLen
>SYSCALL GetMem0YA
bcs .9
>STYA BufPtr

View File

@ -117,9 +117,8 @@ CS.INIT lda #$ff
jsr LoadFile
bcc .8 if CS, Failed to load file, keep name, but new file....
.1 >PUSHWI 1 buffer size = 0 (+ 1 for ending 0)
>PUSHBI S.MEM.F.INIT0
>SYSCALL GetMem
.1 >LDYAI 1 buffer size = 0 (+ 1 for ending 0)
>SYSCALL GetMem0YA
bcs .9
txa
@ -358,9 +357,7 @@ LoadFile >PUSHWI 0 Aux type
bne .2
inc +1 for ending zero
.2 >PUSHYA
>PUSHBI S.MEM.F.INIT0
>SYSCALL GetMem
.2 >SYSCALL GetMem0YA
bcs .98
>STYA ZPPTR2

View File

@ -216,9 +216,7 @@ CS.RUN.BuildCat ldy #hDev
.99 bcs .9
stx BlkCnt
>PUSHYA BufferSize
>PUSHBI S.MEM.F.INIT0
>SYSCALL GetMem
>SYSCALL GetMem0YA BufferSize
bcs .9
>STYA BlkParams.Ptr
txa

View File

@ -515,7 +515,7 @@ CS.RUN.FILE.MSG clc
.DO X.COPY.TO.DEST=1
ldy #hSrcFullPath
ldy #hDstFullPath
jsr CS.RUN.GetPathY
>PUSHYA

View File

@ -114,20 +114,16 @@ DEV.HEADER.NAME >PSTR "ETH7"
DRV.CS.START .DA STATUS
.DA READBLOCK
.DA WRITEBLOCK
.DA BADCALL
.DA BADCALL
.DA BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA OPEN
.DA CLOSE
.DA BADCALL
.DA BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
L.DEVSTAT .DA DEVSTAT
.DA 0 end or relocation
*--------------------------------------
BADCALL lda #MLI.ERR.BADCALL
sec
rts
*--------------------------------------
STATUS lda #S.DEVSTAT.NET.STATUS.10
sta LINK.STATUS
@ -200,9 +196,7 @@ READBLOCK.RxOK lda #L91C96.2.PTR.RCVD+L91C96.2.PTR.AUTOI+L91C96.2.PTR.READ
bne .11
inc
.11 >PUSHYA FRAMLEN+2
>PUSHBI 0
>SYSCALL GetMem
.11 >SYSCALL GetMemYA
bcs .99
>STYA ZPTmpPTR
stx .8+1

View File

@ -110,22 +110,18 @@ DEV.HEADER.NAME >PSTR "LPT1"
* Driver Code
*--------------------------------------
DRV.CS.START .DA STATUS
.DA BADCALL
.DA BADCALL
.DA BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA CONTROL
.DA BADCALL
.DA A2osX.BADCALL
.DA OPEN
.DA CLOSE
.DA BADCALL
.DA A2osX.BADCALL
.DA WRITE
L.STAT .DA STAT
.DA 0 end or relocation
*--------------------------------------
BADCALL lda #MLI.ERR.BADCALL
sec
rts
*--------------------------------------
STATUS >LDYA L.STAT
clc
rts

View File

@ -112,11 +112,11 @@ DEV.HEADER.NAME >PSTR "COM1" NAME
* Driver Code
*--------------------------------------
DRV.CS.START .DA STATUS
.DA BADCALL
.DA BADCALL
.DA BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA CONTROL
.DA BADCALL
.DA A2osX.BADCALL
.DA OPEN
.DA CLOSE
.DA READ
@ -124,10 +124,6 @@ DRV.CS.START .DA STATUS
L.STAT .DA STAT
.DA 0 end or relocation
*--------------------------------------
BADCALL lda #MLI.ERR.BADCALL
sec
rts
*--------------------------------------
STATUS >LDYA L.STAT
clc
rts

View File

@ -115,11 +115,11 @@ DEV.HEADER.NAME >PSTR "COM1" NAME
* Driver Code
*--------------------------------------
DRV.CS.START .DA STATUS
.DA BADCALL
.DA BADCALL
.DA BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA CONTROL
.DA BADCALL
.DA A2osX.BADCALL
.DA OPEN
.DA CLOSE
.DA READ
@ -128,10 +128,6 @@ DRV.CS.START .DA STATUS
L.STAT .DA STAT
.DA 0 end or relocation
*--------------------------------------
BADCALL lda #MLI.ERR.BADCALL
sec
rts
*--------------------------------------
STATUS >LDYA L.STAT
clc
rts

View File

@ -150,20 +150,16 @@ DEV.HEADER.NAME >PSTR "ETH7"
DRV.CS.START .DA STATUS
.DA READBLOCK
.DA WRITEBLOCK
.DA BADCALL
.DA A2osX.BADCALL
.DA CONTROL
.DA BADCALL
.DA A2osX.BADCALL
.DA OPEN
.DA CLOSE
.DA BADCALL
.DA BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
L.DEVSTAT .DA DEVSTAT
.DA 0 end or relocation
*--------------------------------------
BADCALL lda #MLI.ERR.BADCALL
sec
rts
*--------------------------------------
STATUS >LDYA L.DEVSTAT
clc
rts
@ -210,12 +206,9 @@ READBLOCK.RxOK >AR.SELECT S0.RX.RD
pha
tya
adc /S.IP
>PUSHA
pla
>PUSHA
ply
>PUSHBI 0
>SYSCALL GetMem
>SYSCALL GetMemYA
bcs READBLOCK.RTS
>STYA ZPTmpPTR

View File

@ -144,20 +144,16 @@ DEV.HEADER.NAME >PSTR "ETH7" NAME
DRV.CS.START .DA STATUS
.DA READBLOCK
.DA WRITEBLOCK
.DA BADCALL
.DA BADCALL
.DA BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA OPEN
.DA CLOSE
.DA BADCALL
.DA BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
L.DEVSTAT .DA DEVSTAT
.DA 0 end or relocation
*--------------------------------------
BADCALL lda #MLI.ERR.BADCALL
sec
rts
*--------------------------------------
STATUS lda #S.DEVSTAT.NET.STATUS.10
sta LINK.STATUS
@ -231,9 +227,7 @@ READBLOCK php
lda Size+1
adc #0
>PUSHYA
>PUSHBI 0
>SYSCALL GetMem
>SYSCALL GetMemYA
bcs .9
>STYA ZPTmpPTR

View File

@ -149,20 +149,16 @@ DEV.HEADER.NAME >PSTR "ETH7"
DRV.CS.START .DA STATUS
.DA READBLOCK
.DA WRITEBLOCK
.DA BADCALL
.DA BADCALL
.DA BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
.DA OPEN
.DA CLOSE
.DA BADCALL
.DA BADCALL
.DA A2osX.BADCALL
.DA A2osX.BADCALL
L.DEVSTAT .DA DEVSTAT
.DA 0 end or relocation
*--------------------------------------
BADCALL lda #MLI.ERR.BADCALL
sec
rts
*--------------------------------------
STATUS >LDYA L.DEVSTAT
clc
rts
@ -193,14 +189,11 @@ READBLOCK.RxOK >AR.SELECT S0.RX.RD
lda W5100.DR,x get RX.Size HI
sta RXTX.Size+1
>PUSHA for SYS.GetMem
lda W5100.DR,x get RX.Size LO
sta RXTX.Size
>PUSHA for SYS.GetMem
>PUSHBI 0
>SYSCALL GetMem
ldy W5100.DR,x get RX.Size LO
sty RXTX.Size
>SYSCALL GetMemYA
bcs .99
>STYA ZPTmpPTR
stx .8+1

View File

@ -255,7 +255,7 @@ SYS.FreeMemA .EQ $92
SYS.GetMemPtrA .EQ $94
SYS.GetMemByIDA .EQ $96
SYS.GetMemYA .EQ $98
* .EQ $9A
SYS.GetMem0YA .EQ $9A
* .EQ $9C
* .EQ $9E
*--------------------------------------

View File

@ -155,9 +155,8 @@ MD5PStrA >SYSCALL GetMemPtrA
* Out :
* A = hMem To S.MD5
*--------------------------------------
MD5Init >PUSHWI S.MD5.SIZE
>PUSHBI 0
>SYSCALL GetMem
MD5Init >LDYAI S.MD5.SIZE
>SYSCALL GetMemYA
bcs .9
>STYA ZPTmpPtr1
ldy #0
@ -254,9 +253,8 @@ MD5FinalizeA >SYSCALL GetMemPtrA
lda (ZPTmpPtr1),y
bne .11
jsr MD5ExtraChunk
.11 >PUSHWI 33 Len + 32 Digits
>PUSHBI 0
>SYSCALL GetMem
.11 >LDYAI 33 Len + 32 Digits
>SYSCALL GetMemYA
bcs .9
>STYA ZPTmpPtr2
phx save hMem for return

View File

@ -45,9 +45,7 @@ FRM.NewIP stx .8+1
txa
adc #0
>PUSHYA
>PUSHBI 0
>SYSCALL GetMem
>SYSCALL GetMemYA
bcs .9
stx hFrameOut

View File

@ -1126,9 +1126,8 @@ SKT.AckDataToSktOut
.8 rts
*--------------------------------------
SKT.NewTCB >PUSHWI S.TCB
>PUSHBI S.MEM.F.INIT0
>SYSCALL GetMem
SKT.NewTCB >LDYAI S.TCB
>SYSCALL GetMem0YA
bcs .9
>STYA .4+1
@ -1151,18 +1150,16 @@ SKT.NewTCB >PUSHWI S.TCB
dex
bpl .2
>PUSHWI K.TCP.WSIZE
>PUSHBI 0
>SYSCALL GetMem
>LDYAI K.TCP.WSIZE
>SYSCALL GetMemYA
bcs .9
txa
ldy #S.SOCKET.SQ.hInMem
sta (ZPTmpPtr3),y
>PUSHWI K.TCP.WSIZE
>PUSHBI 0
>SYSCALL GetMem
>LDYAI K.TCP.WSIZE
>SYSCALL GetMemYA
bcs .9
txa

View File

@ -163,6 +163,15 @@ UDP.ComputeChecksum
sta (ZPFrameOutPtr),y
rts
*--------------------------------------
DecDataInLen lda ZPDataInLen
bne .1
lda ZPDataInLen+1
beq .9
dec ZPDataInLen+1
.1 dec ZPDataInLen
lda #$FF Make NZ
.9 rts
*--------------------------------------
MAN
SAVE /A2OSX.SRC/LIB/LIBTCPIP.S.UDP
LOAD /A2OSX.SRC/LIB/LIBTCPIP.S

View File

@ -116,9 +116,8 @@ LIB.LOAD ldx bFirstLoad
jsr ARP.CLEAR
jsr DNS.CLEAR
>PUSHWI K.SKTTABLE.SIZE*S.SOCKET
>PUSHBI S.MEM.F.INIT0
>SYSCALL GetMem
>LDYAI K.SKTTABLE.SIZE*S.SOCKET
>SYSCALL GetMem0YA
bcs .9
stx hSocketTable
@ -203,15 +202,6 @@ GetDynPort inc DYNPORT.LAST
clc
rts
*--------------------------------------
DecDataInLen lda ZPDataInLen
bne .1
lda ZPDataInLen+1
beq .9
dec ZPDataInLen+1
.1 dec ZPDataInLen
lda #$FF Make NZ
.9 rts
*--------------------------------------
NetDevJmp jmp *
*--------------------------------------
.INB /A2OSX.SRC/LIB/LIBTCPIP.S.ARP

View File

@ -216,9 +216,8 @@ CS.RUN.Load >PUSHWI UsrBuf256
sta (pData),y
rts
.99 >PUSHWI 16
>PUSHBI S.MEM.F.INIT0
>SYSCALL GetMem
.99 >LDYAI 16
>SYSCALL GetMem0YA
>STYA ZPTmp1

View File

@ -1,13 +1,12 @@
PR#3
PREFIX /A2OSX.BUILD
NEW
LOMEM $A00
INC 1
AUTO 6
.LIST OFF
*--------------------------------------
HIS.Init >PUSHWI 256 Get a buffer for History
>PUSHBI S.MEM.F.INIT0
>SYSCALL GetMem
HIS.Init >LDYAI 256 Get a buffer for History
>SYSCALL GetMem0YA
bcs .9
txa

View File

@ -80,7 +80,7 @@ K.ExpandPStrYA stz K.ExpandPStr.hPStr Reset Intermediate string...
inx must be a $? or ?x.....go expand
stx K.ExpandPStr.Name
sta K.ExpandPStr.Name+1
bra .51
bra .51 go Expand....
.32 ldx K.ExpandPStr.Name
inx
@ -93,12 +93,12 @@ K.ExpandPStrYA stz K.ExpandPStr.hPStr Reset Intermediate string...
.5 dey last char was invalid...move back
.50 ldx K.ExpandPStr.Name
beq .51 var name is empty...start over
beq .52 var name is empty...start over
phy save current index
.51 phy save current index
jsr K.ExpandPStrGetValue
ply restore index in string...
.51 jmp .10 reset start flag and continue
.52 jmp .10 reset start flag and continue
.8 ldx K.ExpandPStr.Name end of PSTR,are we in a var?
beq .80 no...exit...
@ -342,7 +342,7 @@ ENV.ExpandSysVar
ldx K.ExpandPStr.Name
cpx #1 is name 1 char?
bne .9
ldy #1
lda K.ExpandPStr.Name+1
cmp #'0'-1 $0...$9 ??

View File

@ -453,9 +453,8 @@ TskMgrInit >LDYAI TskMgr.Table+S.PS Clear whole process table except PS0
.3 dex
bne .1
>PUSHWI K.ENV.SIZE get a buffer for ENV
>PUSHBI S.MEM.F.INIT0 make sure blank
>SYSCALL GetMem create it...
>LDYAI K.ENV.SIZE get a buffer for ENV
>SYSCALL GetMem0YA make sure blank!!
bcs .9
txa

View File

@ -98,7 +98,7 @@ K.SYSCALL.JMP .DA K.FileSearch $00
.DA K.GetMemPtrA
.DA K.GetMemByIDA
.DA K.GetMemYA
.DA 0
.DA K.GetMem0YA
.DA 0
.DA 0
*--------------------------------------

View File

@ -63,6 +63,20 @@ K.GetMem >PULLB MemMgr.ReqFlags store requested flags
.9 rts
*/--------------------------------------
* # GetMem0YA
* ## In:
* Y,A = Size Requested
* ## Out:
* CC : success
* YA = PTR to Mem (ZERO Initialised)
* X = hMem
* CS :
* A = EC
*\--------------------------------------
K.GetMem0YA ldx #S.MEM.F.INIT0
stx MemMgr.ReqFlags
.HS 2C bit abs
*/--------------------------------------
* # GetMemYA
* ## In:
* Y,A = Size Requested
@ -73,10 +87,6 @@ K.GetMem >PULLB MemMgr.ReqFlags store requested flags
* CS :
* A = EC
*\--------------------------------------
K.GetMem0YA ldx #S.MEM.F.INIT0
stx MemMgr.ReqFlags
.HS 2C bit abs
K.GetMemYA stz MemMgr.ReqFlags
sta MemMgr.ReqSize+1
tya