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
lda (ZPMacroBuf)
cmp #254
beq .9 CS if EQ
* cmp #254
* beq .9 CS if EQ
inc
sta (ZPMacroBuf)
@ -50,6 +50,21 @@ MAC.AddChar tax
txa
sta (ZPMacroBuf),y
tax
beq .1
* >SYSCALL PutChar.A
clc
rts
.1
* lda #13
* >SYSCALL PutChar.A
* lda #10
* >SYSCALL PutChar.A
clc
.9 rts
*---------------------------------------

View File

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

View File

@ -214,9 +214,12 @@ CS.RUN >SYSCALL GetChar
lda (pData),y
eor #$ff
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
bne .10
@ -427,13 +430,13 @@ DIR.Counter .BS 2
DIR.Byte .BS 1
ASM.PASS .BS 1
ASM.MACRO.ON .BS 1
ASM.DO.Count .BS 1
ASM.DOELSE.Flag .BS SRC.DO.MAXDEPTH
ASM.DO.ON .BS 1
ASM.PH.ON .BS 1
ASM.LI.ON .BS 1
ASM.LI.CON .BS 1
ASM.LI.MON .BS 1
ASM.LI.XON .BS 1
ASM.PC .BS 4
ASM.PC.PH .BS 4

View File

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

View File

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