mirror of
https://github.com/A2osX/A2osX.git
synced 2025-07-18 00:24:07 +00:00
Kernel 0.9.1 : ASM rewrite....
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -85,6 +85,7 @@ DIR.BS jsr EXP.Eval
|
|||||||
.99 lda #ERR.RANGE
|
.99 lda #ERR.RANGE
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.98 lda #ERR.SYNTAX.ERROR
|
.98 lda #ERR.SYNTAX.ERROR
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
@@ -172,16 +173,24 @@ DIR.EP ldy #ASM.PH.ON
|
|||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
DIR.EQ jsr EXP.Eval
|
DIR.EQ jsr SRC.GetNextCharNB
|
||||||
|
beq .99
|
||||||
|
|
||||||
|
jsr EXP.Eval
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
ldx #3
|
ldx #3
|
||||||
|
|
||||||
.1 lda SRC.ACC,x
|
.1 lda SRC.ACC,x
|
||||||
sta SRC.GLabel.Value,x
|
sta SRC.GLabel.Value,x
|
||||||
dex
|
dex
|
||||||
bpl .1
|
bpl .1
|
||||||
|
|
||||||
clc
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
.99 lda #ERR.SYNTAX.ERROR
|
||||||
|
sec
|
||||||
.9 rts
|
.9 rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
DIR.FI ldy #ASM.DO.Count
|
DIR.FI ldy #ASM.DO.Count
|
||||||
@@ -265,12 +274,14 @@ DIR.LI.9 lda #ERR.SYNTAX.ERROR
|
|||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
DIR.MA jsr SRC.CheckBlank Get Macro Name
|
DIR.MA jsr SRC.GetNextCharNB
|
||||||
bcs .9
|
beq .9
|
||||||
|
|
||||||
.1 jsr FIO.ReadLine
|
.1 jsr FIO.ReadLine
|
||||||
bcs .99
|
bcs .99
|
||||||
|
|
||||||
|
jsr SRC.PrintLine
|
||||||
|
|
||||||
lda (ZPLineBuf)
|
lda (ZPLineBuf)
|
||||||
beq .1
|
beq .1
|
||||||
|
|
||||||
|
@@ -63,10 +63,7 @@ EXP.Eval.Next1 cmp #'.' Local Label?
|
|||||||
|
|
||||||
.1 cmp #'$' Hex?
|
.1 cmp #'$' Hex?
|
||||||
bne .2
|
bne .2
|
||||||
>DEBUG
|
|
||||||
|
|
||||||
jsr SRC.GetNextChar
|
|
||||||
beq EXP.EvalExitSYN
|
|
||||||
jsr SRC.GetHex
|
jsr SRC.GetHex
|
||||||
|
|
||||||
bcs EXP.EvalExitSYN
|
bcs EXP.EvalExitSYN
|
||||||
@@ -226,7 +223,7 @@ EXP.OP.GRT
|
|||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
EXP.OP.ADD ldx #0 ARG-ACC->ACC
|
EXP.OP.ADD ldx #0 ARG-ACC->ACC
|
||||||
ldy #4
|
ldy #4
|
||||||
|
|
||||||
clc
|
clc
|
||||||
@@ -243,7 +240,7 @@ EXP.OP.ADD ldx #0 ARG-ACC->ACC
|
|||||||
lda #ERR.VAL.TOO.BIG
|
lda #ERR.VAL.TOO.BIG
|
||||||
.8 rts
|
.8 rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
EXP.OP.SUB ldx #0 ARG-ACC->ACC
|
EXP.OP.SUB ldx #0 ARG-ACC->ACC
|
||||||
ldy #4
|
ldy #4
|
||||||
|
|
||||||
sec
|
sec
|
||||||
|
@@ -204,7 +204,7 @@ FIO.ReadLine >LDYA ZPLineBuf
|
|||||||
|
|
||||||
.2 cmp #$C0 REPEAT char?
|
.2 cmp #$C0 REPEAT char?
|
||||||
bne .5
|
bne .5
|
||||||
|
|
||||||
lda (ZPPtr1) Get Repeat Count
|
lda (ZPPtr1) Get Repeat Count
|
||||||
inc ZPPtr1
|
inc ZPPtr1
|
||||||
bne .3
|
bne .3
|
||||||
@@ -214,7 +214,7 @@ FIO.ReadLine >LDYA ZPLineBuf
|
|||||||
|
|
||||||
lda (ZPPtr1) Get Repeat Char
|
lda (ZPPtr1) Get Repeat Char
|
||||||
inc ZPPtr1
|
inc ZPPtr1
|
||||||
bne .3
|
bne .4
|
||||||
inc ZPPtr1+1
|
inc ZPPtr1+1
|
||||||
|
|
||||||
.4 sta (ZPLineBuf),y
|
.4 sta (ZPLineBuf),y
|
||||||
@@ -224,7 +224,7 @@ FIO.ReadLine >LDYA ZPLineBuf
|
|||||||
dex
|
dex
|
||||||
bne .4
|
bne .4
|
||||||
|
|
||||||
bra .99
|
bra .1
|
||||||
|
|
||||||
.5 and #$3F Compute blank count
|
.5 and #$3F Compute blank count
|
||||||
tax
|
tax
|
||||||
|
@@ -2,7 +2,9 @@ NEW
|
|||||||
PREFIX /A2OSX.BUILD
|
PREFIX /A2OSX.BUILD
|
||||||
AUTO 4,1
|
AUTO 4,1
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
SRC.PrintLine >LDA.G ASM.MACRO.ON
|
SRC.PrintLine bra .8
|
||||||
|
|
||||||
|
>LDA.G ASM.MACRO.ON
|
||||||
bpl .1
|
bpl .1
|
||||||
|
|
||||||
>LDA.G ASM.LI.CON
|
>LDA.G ASM.LI.CON
|
||||||
@@ -10,7 +12,7 @@ SRC.PrintLine >LDA.G ASM.MACRO.ON
|
|||||||
bmi .8
|
bmi .8
|
||||||
|
|
||||||
.1 >LDA.G ASM.LI.ON
|
.1 >LDA.G ASM.LI.ON
|
||||||
* bpl .9
|
bpl .9
|
||||||
|
|
||||||
.8 >PUSHW ZPLineBuf
|
.8 >PUSHW ZPLineBuf
|
||||||
>PUSHW SRC.LINENUM
|
>PUSHW SRC.LINENUM
|
||||||
@@ -22,17 +24,10 @@ SRC.PrintLine >LDA.G ASM.MACRO.ON
|
|||||||
>SYSCALL PrintF.YA
|
>SYSCALL PrintF.YA
|
||||||
.9 rts
|
.9 rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
SRC.PrintLineErr >LDYA ZPLineBuf
|
SRC.PrintLineErr >PUSHW ZPLineBuf
|
||||||
|
>LDYA L.MSG.LINECR
|
||||||
>SYSCALL PrintF.YA
|
>SYSCALL PrintF.YA
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
lda #13
|
|
||||||
>SYSCALL PutChar.A
|
|
||||||
bcs .9
|
|
||||||
|
|
||||||
lda #10
|
|
||||||
>SYSCALL PutChar.A
|
|
||||||
bcs .9
|
|
||||||
|
|
||||||
lda ZPLinePtr
|
lda ZPLinePtr
|
||||||
sec
|
sec
|
||||||
@@ -115,7 +110,9 @@ SRC.ParseLine lda (ZPLineBuf)
|
|||||||
|
|
||||||
SRC.ParseLine.Ok lda SRC.GLabel.New
|
SRC.ParseLine.Ok lda SRC.GLabel.New
|
||||||
bpl .8
|
bpl .8
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
ldy #ASM.PASS
|
ldy #ASM.PASS
|
||||||
lda (pData),y pass#2?
|
lda (pData),y pass#2?
|
||||||
bne .8 yes, nothing to do
|
bne .8 yes, nothing to do
|
||||||
@@ -256,11 +253,8 @@ SRC.ParseLine.Add.Macro
|
|||||||
rts
|
rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
SRC.ParseLine.OpCode
|
SRC.ParseLine.OpCode
|
||||||
jsr SRC.CheckBlank
|
|
||||||
bcc .11
|
ldy #ASM.T.hMem
|
||||||
rts
|
|
||||||
|
|
||||||
.11 ldy #ASM.T.hMem
|
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
>SYSCALL GetMemPtr.A
|
>SYSCALL GetMemPtr.A
|
||||||
>STYA ZPPtr1
|
>STYA ZPPtr1
|
||||||
@@ -285,11 +279,9 @@ SRC.ParseLine.OpCode
|
|||||||
adc ZPPtr1+1
|
adc ZPPtr1+1
|
||||||
sta ZPPtr3+1
|
sta ZPPtr3+1
|
||||||
|
|
||||||
|
|
||||||
.10 lda (ZPPtr2) End Of OpCode List
|
.10 lda (ZPPtr2) End Of OpCode List
|
||||||
beq .9
|
beq .9
|
||||||
|
|
||||||
lda (ZPPtr2) Opcode Len
|
|
||||||
tax
|
tax
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
@@ -542,6 +534,8 @@ SRC.GetHex stz SRC.ACC+1
|
|||||||
stz SRC.ACC+2
|
stz SRC.ACC+2
|
||||||
stz SRC.ACC+3
|
stz SRC.ACC+3
|
||||||
|
|
||||||
|
jsr SRC.GetNextChar
|
||||||
|
|
||||||
lda (ZPLinePtr)
|
lda (ZPLinePtr)
|
||||||
beq .99
|
beq .99
|
||||||
jsr SRC.IsDigit16
|
jsr SRC.IsDigit16
|
||||||
@@ -587,6 +581,8 @@ SRC.GetOctal stz SRC.ACC+1
|
|||||||
stz SRC.ACC+2
|
stz SRC.ACC+2
|
||||||
stz SRC.ACC+3
|
stz SRC.ACC+3
|
||||||
|
|
||||||
|
jsr SRC.GetNextChar
|
||||||
|
|
||||||
lda (ZPLinePtr)
|
lda (ZPLinePtr)
|
||||||
beq .99
|
beq .99
|
||||||
|
|
||||||
@@ -643,6 +639,8 @@ SRC.GetBinary stz SRC.ACC+1
|
|||||||
stz SRC.ACC+2
|
stz SRC.ACC+2
|
||||||
stz SRC.ACC+3
|
stz SRC.ACC+3
|
||||||
|
|
||||||
|
jsr SRC.GetNextChar
|
||||||
|
|
||||||
lda (ZPLinePtr)
|
lda (ZPLinePtr)
|
||||||
beq .99
|
beq .99
|
||||||
|
|
||||||
|
@@ -285,7 +285,7 @@ SYM.SetGBlockPtr ldy #SYM.pLastGBlock
|
|||||||
lda (pData),y
|
lda (pData),y
|
||||||
|
|
||||||
SYM.GetGBlockA clc
|
SYM.GetGBlockA clc
|
||||||
adc #SYM.hGBlocks
|
adc #SYM.hGBlocks-1
|
||||||
tay
|
tay
|
||||||
lda (pData),y
|
lda (pData),y
|
||||||
phx
|
phx
|
||||||
|
@@ -74,6 +74,7 @@ CS.START cld
|
|||||||
.DA CS.QUIT
|
.DA CS.QUIT
|
||||||
L.MSG.HELP .DA MSG.HELP
|
L.MSG.HELP .DA MSG.HELP
|
||||||
L.MSG.SRCLINE .DA MSG.SRCLINE
|
L.MSG.SRCLINE .DA MSG.SRCLINE
|
||||||
|
L.MSG.LINECR .DA MSG.LINECR
|
||||||
L.MSG.ERROR .DA MSG.ERROR
|
L.MSG.ERROR .DA MSG.ERROR
|
||||||
L.MSG.SYMBOLS .DA MSG.SYMBOLS
|
L.MSG.SYMBOLS .DA MSG.SYMBOLS
|
||||||
L.MSG.GSYMBOL .DA MSG.GSYMBOL
|
L.MSG.GSYMBOL .DA MSG.GSYMBOL
|
||||||
@@ -261,7 +262,7 @@ CS.RUN >SYSCALL GetChar
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
.2 jsr SRC.PrintLine
|
.2 jsr SRC.PrintLine
|
||||||
|
|
||||||
jsr SRC.ParseLine
|
jsr SRC.ParseLine
|
||||||
bcs .9
|
bcs .9
|
||||||
|
|
||||||
@@ -375,6 +376,7 @@ MSG.SRC.FILE >CSTR "Reading SRC File:%s\r\n"
|
|||||||
MSG.OBJ.FILE >CSTR "Writing OBJ File:%s, Type=%02x\r\n"
|
MSG.OBJ.FILE >CSTR "Writing OBJ File:%s, Type=%02x\r\n"
|
||||||
MSG.T.FILE >CSTR "Loading CPU File:%s\r\n"
|
MSG.T.FILE >CSTR "Loading CPU File:%s\r\n"
|
||||||
MSG.SRCLINE >CSTR "%H: %05D-%s\r\n"
|
MSG.SRCLINE >CSTR "%H: %05D-%s\r\n"
|
||||||
|
MSG.LINECR >CSTR "%s\r\n"
|
||||||
MSG.ERROR >CSTR "%05D-Error:$%h\r\n"
|
MSG.ERROR >CSTR "%05D-Error:$%h\r\n"
|
||||||
MSG.SYMBOLS >CSTR "Symbol Table:\r\n"
|
MSG.SYMBOLS >CSTR "Symbol Table:\r\n"
|
||||||
MSG.GSYMBOL >CSTR "$%H%H:%S"
|
MSG.GSYMBOL >CSTR "$%H%H:%S"
|
||||||
|
@@ -202,7 +202,7 @@ VSDRIVE.Ping ldx DRV+2 DRV.Slotn0
|
|||||||
and #SSC.STATUS.RDRF incoming char?
|
and #SSC.STATUS.RDRF incoming char?
|
||||||
bne .6
|
bne .6
|
||||||
|
|
||||||
jsr VSDRIVE.Wait
|
* jsr VSDRIVE.Wait
|
||||||
|
|
||||||
jsr VSDRIVE.IncTimer
|
jsr VSDRIVE.IncTimer
|
||||||
bne .5
|
bne .5
|
||||||
|
Reference in New Issue
Block a user