Kernel 0.9.1 : ASM rewrite....Macros & bugfix

This commit is contained in:
Rémy GIBERT 2018-01-30 16:24:45 +00:00
parent ad0d14982f
commit e8db11ec59
7 changed files with 69 additions and 60 deletions

Binary file not shown.

Binary file not shown.

View File

@ -40,8 +40,8 @@ MAC.Clear lda #0
*--------------------------------------- *---------------------------------------
MAC.AddChar tax MAC.AddChar tax
lda (ZPMacroBuf) lda (ZPMacroBuf)
cmp #254 * cmp #254
beq .9 CS if EQ * beq .9 CS if EQ
inc inc
sta (ZPMacroBuf) sta (ZPMacroBuf)
@ -50,6 +50,21 @@ MAC.AddChar tax
txa txa
sta (ZPMacroBuf),y sta (ZPMacroBuf),y
tax
beq .1
* >SYSCALL PutChar.A
clc
rts
.1
* lda #13
* >SYSCALL PutChar.A
* lda #10
* >SYSCALL PutChar.A
clc clc
.9 rts .9 rts
*--------------------------------------- *---------------------------------------

View File

@ -2,16 +2,16 @@ NEW
PREFIX /A2OSX.BUILD PREFIX /A2OSX.BUILD
AUTO 4,1 AUTO 4,1
*--------------------------------------- *---------------------------------------
SRC.PrintLine >LDA.G ASM.MACRO.ON SRC.PrintLine >LDA.G ASM.LI.ON
bpl .9
>LDA.G MAC.bAdd
bpl .1 bpl .1
>LDA.G ASM.LI.CON >LDA.G ASM.LI.MON
bpl .9 bpl .9
bmi .8 bmi .8
.1 >LDA.G ASM.LI.ON .1
bpl .9
.8 >PUSHW ZPLineBuf .8 >PUSHW ZPLineBuf
>PUSHW.G SRC.LINENUM >PUSHW.G SRC.LINENUM
ldy #ASM.PC+1 ldy #ASM.PC+1
@ -81,7 +81,7 @@ SRC.ParseLine.Macro >LDA.G ASM.PASS If Pass#2, ignore
lda #' ' Store ONE blank lda #' ' Store ONE blank
jsr MAC.AddChar jsr MAC.AddChar
bcs .99 bcs .90
lda (ZPLinePtr) get back non blank char lda (ZPLinePtr) get back non blank char
bra .2 bra .2
@ -90,15 +90,15 @@ SRC.ParseLine.Macro >LDA.G ASM.PASS If Pass#2, ignore
bcs .99 bcs .99
jsr SRC.GetNextChar jsr SRC.GetNextChar
bcs .8 bcs .80
cmp #' ' cmp #' '
bne .1 bne .1
jsr MAC.AddChar jsr MAC.AddChar
bcs .99 .90 bcs .99
jsr SRC.GetNextCharNB jsr SRC.GetNextCharNB
bcs .8 bcs .80
.2 cmp #'.' Directive ? .2 cmp #'.' Directive ?
bne .4 bne .4
@ -128,31 +128,42 @@ SRC.ParseLine.Macro >LDA.G ASM.PASS If Pass#2, ignore
.8 clc .8 clc
rts rts
.80 lda #0
jmp MAC.AddChar
.3 lda (ZPLinePtr) .3 lda (ZPLinePtr)
.4 jsr MAC.AddChar .4 jsr MAC.AddChar
bcs .99 bcs .99
jsr SRC.GetNextChar jsr SRC.GetNextChar
bcs .8 bcs .80
cmp #' ' cmp #' '
bne .4 bne .4
jsr SRC.GetNextChar jsr SRC.GetNextChar
bcs .8 bcs .8
cmp #' ' cmp #' '
beq .8 Comments... beq .80 Comments...
pha
lda #' '
jsr MAC.AddChar
pla
bcs .99
.5 jsr MAC.AddChar Store ARG.... .5 jsr MAC.AddChar Store ARG....
bcs .99 bcs .99
jsr SRC.GetNextChar jsr SRC.GetNextChar
bcs .8 bcs .80
cmp #' ' cmp #' '
bne .5 bne .5
lda #0 lda #0
jsr MAC.AddChar End of Line jmp MAC.AddChar End of Line
clc clc
rts rts

View File

@ -214,9 +214,12 @@ CS.RUN >SYSCALL GetChar
lda (pData),y lda (pData),y
eor #$ff eor #$ff
sta (pData),y sta (pData),y
bne .8
.11 ldy #SRC.COUNT root file is already opened? .11 ldy #bPause
lda (pData),y
bne .8
ldy #SRC.COUNT root file is already opened?
lda (pData),y lda (pData),y
bne .10 bne .10
@ -427,13 +430,13 @@ DIR.Counter .BS 2
DIR.Byte .BS 1 DIR.Byte .BS 1
ASM.PASS .BS 1 ASM.PASS .BS 1
ASM.MACRO.ON .BS 1
ASM.DO.Count .BS 1 ASM.DO.Count .BS 1
ASM.DOELSE.Flag .BS SRC.DO.MAXDEPTH ASM.DOELSE.Flag .BS SRC.DO.MAXDEPTH
ASM.DO.ON .BS 1 ASM.DO.ON .BS 1
ASM.PH.ON .BS 1 ASM.PH.ON .BS 1
ASM.LI.ON .BS 1 ASM.LI.ON .BS 1
ASM.LI.CON .BS 1 ASM.LI.CON .BS 1
ASM.LI.MON .BS 1
ASM.LI.XON .BS 1 ASM.LI.XON .BS 1
ASM.PC .BS 4 ASM.PC .BS 4
ASM.PC.PH .BS 4 ASM.PC.PH .BS 4

View File

@ -27,36 +27,31 @@ ZPSListData .EQ ZPMEMMGR+14
*\-------------------------------------- *\--------------------------------------
K.GetMemStat.YA >STYA ZPMemMgrTmp1 K.GetMemStat.YA >STYA ZPMemMgrTmp1
>LDYAI Mem.Table
>STYA .2+1
ldy #6 ldy #6
jsr .1
.1 lda Mem.Table,y
sta (ZPMemMgrTmp1),y
dey
bpl .1
ldx #6
ldy #14
sta SETREADAUX sta SETREADAUX
.2 lda Mem.Table,x ldy #14
jsr .1
sta CLRREADAUX
>LDYAI DevMgr.Stat
>STYA .2+1
ldy #22
.1 ldx #6
.2 lda $FFFF,x SELF MODIFIED
sta (ZPMemMgrTmp1),y sta (ZPMemMgrTmp1),y
dey dey
dex dex
bpl .2 bpl .2
sta CLRREADAUX
ldx #6
ldy #22
.3 lda DevMgr.Stat,x
sta (ZPMemMgrTmp1),y
dey
dex
bpl .3
rts rts
*/-------------------------------------- */--------------------------------------
* # GetMem0.YA * # GetMem0.YA
@ -550,7 +545,7 @@ K.SListNew
*\-------------------------------------- *\--------------------------------------
K.SListFree.A K.SListFree.A
*-------------------------------------- *--------------------------------------
MEM.SLIST.JMP sta SETREADAUX sta SETREADAUX
sta SETWRITEAUX sta SETWRITEAUX
jsr X.SLIST jsr X.SLIST
sta CLRREADAUX sta CLRREADAUX

View File

@ -195,8 +195,7 @@ SLIST.Select jsr K.GetMemPtr.A
ldy ZPSListKey+1 ldy ZPSListKey+1
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
@ -210,8 +209,7 @@ SLIST.Search jsr K.GetMemPtr.A
stz SLIST.IndexOfs stz SLIST.IndexOfs
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
@ -223,10 +221,6 @@ SLIST.Search jsr K.GetMemPtr.A
beq .9 beq .9
.1 ldy #0 .1 ldy #0
cmp #30
bcs *
.2 jsr MEM.GetKeyCharY .2 jsr MEM.GetKeyCharY
bcs .40 bcs .40
@ -257,9 +251,6 @@ SLIST.Search jsr K.GetMemPtr.A
dex dex
bne .4 bne .4
cmp #30
bcs *
.41 tax A=get Data Len .41 tax A=get Data Len
.5 jsr SLIST.GetNextBlockByte skip data bytes .5 jsr SLIST.GetNextBlockByte skip data bytes
@ -293,7 +284,7 @@ SLIST.GetNextBlockByte
.1 ldy SLIST.IndexOfs .1 ldy SLIST.IndexOfs
iny iny
lda (ZPSListIndex),y lda (ZPSListIndex),y
beq .9 beq .9 Exit with A=0
sty SLIST.IndexOfs sty SLIST.IndexOfs
@ -302,12 +293,7 @@ SLIST.GetNextBlockByte
stz SLIST.BlockOfs stz SLIST.BlockOfs
lda (ZPSListBlock) lda (ZPSListBlock)
ply .9 ply
rts
.9 >DEBUG
lda #0
ply
rts rts
SLIST.GetBlockByte SLIST.GetBlockByte
@ -365,7 +351,6 @@ SLIST.SetBlockByte
* stz SLIST.BlockOfs * stz SLIST.BlockOfs
.8 ply .8 ply
clc
rts rts
*-------------------------------------- *--------------------------------------
SLIST.IndexOfs .BS 1 SLIST.IndexOfs .BS 1