Kernel 0.9.1 : ASM rewrite, SLIST Debugging

This commit is contained in:
Rémy GIBERT 2018-01-25 16:13:28 +00:00
parent cc36ac74e5
commit ce0894c9c6
7 changed files with 65 additions and 38 deletions

Binary file not shown.

Binary file not shown.

View File

@ -99,7 +99,7 @@ SRC.ParseLine lda #0
jsr SYM.LookupGlobal jsr SYM.LookupGlobal
bcs SRC.ParseLine.Undef bcs SRC.ParseLine.Undef
jsr SYM.UpdateGlobal * jsr SYM.UpdateGlobal
bra SRC.ParseLine.DirOp bra SRC.ParseLine.DirOp
.6 jsr SYM.AddGlobalPC .6 jsr SYM.AddGlobalPC

View File

@ -41,7 +41,7 @@ SYM.Dump >LDYA L.MSG.SYMBOLS
stz ZPLinePtr stz ZPLinePtr
stz ZPLinePtr+1 stz ZPLinePtr+1
>DEBUG
.1 >PUSHB.G SYM.hGlobals .1 >PUSHB.G SYM.hGlobals
>PUSHW ZPLinePtr >PUSHW ZPLinePtr
>PUSHW ZPTmpBuf >PUSHW ZPTmpBuf
@ -70,7 +70,7 @@ SYM.Dump >LDYA L.MSG.SYMBOLS
>LDYA L.MSG.GSYMBOL >LDYA L.MSG.GSYMBOL
>SYSCALL PrintF.YA >SYSCALL PrintF.YA
>DEBUG
bcc .1 bcc .1
rts rts

View File

@ -268,7 +268,6 @@ CS.RUN >SYSCALL GetChar
.9 pha .9 pha
jsr SRC.PrintLineErr jsr SRC.PrintLineErr
>DEBUG
jsr SYM.Dump jsr SYM.Dump
pla pla
pha pha

View File

@ -384,9 +384,9 @@ S.PS.PC .EQ 14
S.PS.ARGC .EQ 16 S.PS.ARGC .EQ 16
S.PS.hARGS .EQ 17 S.PS.hARGS .EQ 17
S.PS.ZP .EQ 24 24 Bytes S.PS.ZP .EQ 24 8+32 Bytes
* *
S.PS .EQ 48 S.PS .EQ 64
*-------------------------------------- *--------------------------------------
* LIB Function Indexes * LIB Function Indexes
*-------------------------------------- *--------------------------------------

View File

@ -74,7 +74,7 @@ SLIST.Lookup jsr SLIST.Search
tax tax
jsr MEM.SetDataByteY jsr MEM.SetDataByteY
.1 jsr SLIST.NextBlockByte .1 jsr SLIST.GetNextBlockByte
iny iny
jsr MEM.SetDataByteY jsr MEM.SetDataByteY
dex dex
@ -97,26 +97,26 @@ SLIST.GetByID jsr SLIST.Select
jsr MEM.SetDataByteY jsr MEM.SetDataByteY
.1 jsr SLIST.NextBlockByte .1 jsr SLIST.GetNextBlockByte
iny iny
jsr MEM.SetDataByteY jsr MEM.SetDataByteY
dex dex
bne .1 bne .1
jsr SLIST.NextBlockByte jsr SLIST.GetNextBlockByte
tax tax
iny iny
jsr MEM.SetDataByteY jsr MEM.SetDataByteY
.2 jsr SLIST.NextBlockByte .2 jsr SLIST.GetNextBlockByte
iny iny
jsr MEM.SetDataByteY jsr MEM.SetDataByteY
dex dex
bne .2 bne .2
jsr SLIST.NextBlockByte jsr SLIST.GetNextBlockByte
lda SLIST.IndexOfs lda SLIST.IndexOfs
ldy SLIST.BlockOfs ldy SLIST.BlockOfs
@ -133,11 +133,11 @@ SLIST.UpdateByID
jsr SLIST.GetBlockByte jsr SLIST.GetBlockByte
tax tax
.1 jsr SLIST.NextBlockByte .1 jsr SLIST.GetNextBlockByte
dex dex
bne .1 bne .1
jsr SLIST.NextBlockByte set pos at DATALEN jsr SLIST.GetNextBlockByte set pos at DATALEN
ldy #0 ldy #0
@ -196,7 +196,7 @@ SLIST.Select jsr K.GetMemPtr.A
sty SLIST.IndexOfs sty SLIST.IndexOfs
lda (ZPSListIndex),y lda (ZPSListIndex),y
beq *
jsr K.GetMemPtr.A jsr K.GetMemPtr.A
>STYA ZPSListBlock >STYA ZPSListBlock
@ -211,7 +211,7 @@ SLIST.Search jsr K.GetMemPtr.A
stz SLIST.ID+1 stz SLIST.ID+1
lda (ZPSListIndex) lda (ZPSListIndex)
beq *
jsr K.GetMemPtr.A jsr K.GetMemPtr.A
>STYA ZPSListBlock >STYA ZPSListBlock
@ -219,18 +219,21 @@ SLIST.Search jsr K.GetMemPtr.A
stz SLIST.ID stz SLIST.ID
jsr SLIST.GetBlockByte jsr SLIST.GetBlockByte
tax tax
beq .9 beq .9
.1 ldy #0 .1 ldy #0
cmp #30
bcs *
.2 jsr MEM.GetKeyCharY .2 jsr MEM.GetKeyCharY
bcs .4 bcs .40
iny iny
sta .3+1 sta .3+1
jsr SLIST.NextBlockByte jsr SLIST.GetNextBlockByte
.3 cmp #$ff SELF MODIFIED .3 cmp #$ff SELF MODIFIED
bne .4 bne .4
@ -240,25 +243,30 @@ SLIST.Search jsr K.GetMemPtr.A
jsr MEM.GetKeyCharY jsr MEM.GetKeyCharY
bcs .8 End of Key....match!!!! bcs .8 End of Key....match!!!!
jsr SLIST.NextBlockByte jsr SLIST.GetNextBlockByte
bra .41 bra .41
.8 jsr SLIST.NextBlockByte Advance to DATA LEN .8 jsr SLIST.GetNextBlockByte Advance to DATA LEN
clc Y = Key Length clc Y = Key Length
rts rts
.4 jsr SLIST.NextBlockByte skip remaining key chars .40 inx
.4 jsr SLIST.GetNextBlockByte skip remaining key chars
dex dex
bne .4 bne .4
cmp #30
bcs *
.41 tax A=get Data Len .41 tax A=get Data Len
.5 jsr SLIST.NextBlockByte skip data bytes .5 jsr SLIST.GetNextBlockByte skip data bytes
dex dex
bne .5 bne .5
jsr SLIST.NextBlockByte jsr SLIST.GetNextBlockByte
ldx SLIST.IndexOfs ldx SLIST.IndexOfs
stx SLIST.ID+1 stx SLIST.ID+1
@ -271,26 +279,42 @@ SLIST.Search jsr K.GetMemPtr.A
.9 sec .9 sec
rts rts
*-------------------------------------- *--------------------------------------
SLIST.NextBlockByte SLIST.GetNextBlockByte
inc SLIST.BlockOfs
bne SLIST.GetBlockByte
phy phy
inc SLIST.IndexOfs ldy SLIST.BlockOfs
ldy SLIST.IndexOfs iny
beq .1
lda (ZPSListBlock),y
sty SLIST.BlockOfs
ply
rts
.1 ldy SLIST.IndexOfs
iny
lda (ZPSListIndex),y lda (ZPSListIndex),y
beq .9
sty SLIST.IndexOfs
jsr K.GetMemPtr.A jsr K.GetMemPtr.A
>STYA ZPSListBlock >STYA ZPSListBlock
* stz SLIST.BlockOfs stz SLIST.BlockOfs
.HS A9 lda imm
lda (ZPSListBlock)
ply
rts
.9 >DEBUG
lda #0
ply
rts
SLIST.GetBlockByte SLIST.GetBlockByte
phy phy
ldy SLIST.BlockOfs ldy SLIST.BlockOfs
lda (ZPSListBlock),y lda (ZPSListBlock),y
ply ply
clc
rts rts
*-------------------------------------- *--------------------------------------
SLIST.AddBlockByte SLIST.AddBlockByte
@ -300,23 +324,27 @@ SLIST.AddBlockByte
inc SLIST.BlockOfs inc SLIST.BlockOfs
bne .8 bne .8
inc SLIST.IndexOfs phx
>LDYAI 256 >LDYAI 256
jsr K.GetMem0.YA jsr K.GetMem0.YA
bcs .9 bcs .9
>STYA ZPSListBlock >STYA ZPSListBlock
txa txa
inc SLIST.IndexOfs
ldy SLIST.IndexOfs ldy SLIST.IndexOfs
sta (ZPSListIndex),y sta (ZPSListIndex),y
* stz SLIST.BlockOfs * stz SLIST.BlockOfs
plx
.8 ply .8 ply
clc clc
rts rts
.9 ply .9 plx
ply
sec sec
rts rts
*-------------------------------------- *--------------------------------------
@ -331,7 +359,7 @@ SLIST.SetBlockByte
ldy SLIST.IndexOfs ldy SLIST.IndexOfs
lda (ZPSListIndex),y lda (ZPSListIndex),y
beq *
jsr K.GetMemPtr.A jsr K.GetMemPtr.A
>STYA ZPSListBlock >STYA ZPSListBlock
* stz SLIST.BlockOfs * stz SLIST.BlockOfs