Kernel 0.9.1 : ASM rewrite....

This commit is contained in:
Rémy GIBERT 2018-01-12 16:05:04 +00:00
parent 45474d544c
commit 3f30f72f0f
9 changed files with 41 additions and 33 deletions

Binary file not shown.

Binary file not shown.

View File

@ -85,6 +85,7 @@ DIR.BS jsr EXP.Eval
.99 lda #ERR.RANGE
sec
rts
.98 lda #ERR.SYNTAX.ERROR
sec
rts
@ -172,16 +173,24 @@ DIR.EP ldy #ASM.PH.ON
sec
rts
*---------------------------------------
DIR.EQ jsr EXP.Eval
DIR.EQ jsr SRC.GetNextCharNB
beq .99
jsr EXP.Eval
bcs .9
ldx #3
.1 lda SRC.ACC,x
sta SRC.GLabel.Value,x
dex
bpl .1
clc
rts
.99 lda #ERR.SYNTAX.ERROR
sec
.9 rts
*---------------------------------------
DIR.FI ldy #ASM.DO.Count
@ -265,12 +274,14 @@ DIR.LI.9 lda #ERR.SYNTAX.ERROR
sec
rts
*---------------------------------------
DIR.MA jsr SRC.CheckBlank Get Macro Name
bcs .9
DIR.MA jsr SRC.GetNextCharNB
beq .9
.1 jsr FIO.ReadLine
bcs .99
jsr SRC.PrintLine
lda (ZPLineBuf)
beq .1

View File

@ -63,10 +63,7 @@ EXP.Eval.Next1 cmp #'.' Local Label?
.1 cmp #'$' Hex?
bne .2
>DEBUG
jsr SRC.GetNextChar
beq EXP.EvalExitSYN
jsr SRC.GetHex
bcs EXP.EvalExitSYN
@ -226,7 +223,7 @@ EXP.OP.GRT
clc
rts
*---------------------------------------
EXP.OP.ADD ldx #0 ARG-ACC->ACC
EXP.OP.ADD ldx #0 ARG-ACC->ACC
ldy #4
clc
@ -243,7 +240,7 @@ EXP.OP.ADD ldx #0 ARG-ACC->ACC
lda #ERR.VAL.TOO.BIG
.8 rts
*---------------------------------------
EXP.OP.SUB ldx #0 ARG-ACC->ACC
EXP.OP.SUB ldx #0 ARG-ACC->ACC
ldy #4
sec

View File

@ -204,7 +204,7 @@ FIO.ReadLine >LDYA ZPLineBuf
.2 cmp #$C0 REPEAT char?
bne .5
lda (ZPPtr1) Get Repeat Count
inc ZPPtr1
bne .3
@ -214,7 +214,7 @@ FIO.ReadLine >LDYA ZPLineBuf
lda (ZPPtr1) Get Repeat Char
inc ZPPtr1
bne .3
bne .4
inc ZPPtr1+1
.4 sta (ZPLineBuf),y
@ -224,7 +224,7 @@ FIO.ReadLine >LDYA ZPLineBuf
dex
bne .4
bra .99
bra .1
.5 and #$3F Compute blank count
tax

View File

@ -2,7 +2,9 @@ NEW
PREFIX /A2OSX.BUILD
AUTO 4,1
*---------------------------------------
SRC.PrintLine >LDA.G ASM.MACRO.ON
SRC.PrintLine bra .8
>LDA.G ASM.MACRO.ON
bpl .1
>LDA.G ASM.LI.CON
@ -10,7 +12,7 @@ SRC.PrintLine >LDA.G ASM.MACRO.ON
bmi .8
.1 >LDA.G ASM.LI.ON
* bpl .9
bpl .9
.8 >PUSHW ZPLineBuf
>PUSHW SRC.LINENUM
@ -22,17 +24,10 @@ SRC.PrintLine >LDA.G ASM.MACRO.ON
>SYSCALL PrintF.YA
.9 rts
*---------------------------------------
SRC.PrintLineErr >LDYA ZPLineBuf
SRC.PrintLineErr >PUSHW ZPLineBuf
>LDYA L.MSG.LINECR
>SYSCALL PrintF.YA
bcs .9
lda #13
>SYSCALL PutChar.A
bcs .9
lda #10
>SYSCALL PutChar.A
bcs .9
lda ZPLinePtr
sec
@ -115,7 +110,9 @@ SRC.ParseLine lda (ZPLineBuf)
SRC.ParseLine.Ok lda SRC.GLabel.New
bpl .8
clc
rts
ldy #ASM.PASS
lda (pData),y pass#2?
bne .8 yes, nothing to do
@ -256,11 +253,8 @@ SRC.ParseLine.Add.Macro
rts
*---------------------------------------
SRC.ParseLine.OpCode
jsr SRC.CheckBlank
bcc .11
rts
.11 ldy #ASM.T.hMem
ldy #ASM.T.hMem
lda (pData),y
>SYSCALL GetMemPtr.A
>STYA ZPPtr1
@ -285,11 +279,9 @@ SRC.ParseLine.OpCode
adc ZPPtr1+1
sta ZPPtr3+1
.10 lda (ZPPtr2) End Of OpCode List
beq .9
lda (ZPPtr2) Opcode Len
tax
ldy #0
@ -542,6 +534,8 @@ SRC.GetHex stz SRC.ACC+1
stz SRC.ACC+2
stz SRC.ACC+3
jsr SRC.GetNextChar
lda (ZPLinePtr)
beq .99
jsr SRC.IsDigit16
@ -587,6 +581,8 @@ SRC.GetOctal stz SRC.ACC+1
stz SRC.ACC+2
stz SRC.ACC+3
jsr SRC.GetNextChar
lda (ZPLinePtr)
beq .99
@ -643,6 +639,8 @@ SRC.GetBinary stz SRC.ACC+1
stz SRC.ACC+2
stz SRC.ACC+3
jsr SRC.GetNextChar
lda (ZPLinePtr)
beq .99

View File

@ -285,7 +285,7 @@ SYM.SetGBlockPtr ldy #SYM.pLastGBlock
lda (pData),y
SYM.GetGBlockA clc
adc #SYM.hGBlocks
adc #SYM.hGBlocks-1
tay
lda (pData),y
phx

View File

@ -74,6 +74,7 @@ CS.START cld
.DA CS.QUIT
L.MSG.HELP .DA MSG.HELP
L.MSG.SRCLINE .DA MSG.SRCLINE
L.MSG.LINECR .DA MSG.LINECR
L.MSG.ERROR .DA MSG.ERROR
L.MSG.SYMBOLS .DA MSG.SYMBOLS
L.MSG.GSYMBOL .DA MSG.GSYMBOL
@ -261,7 +262,7 @@ CS.RUN >SYSCALL GetChar
rts
.2 jsr SRC.PrintLine
jsr SRC.ParseLine
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.T.FILE >CSTR "Loading CPU File:%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.SYMBOLS >CSTR "Symbol Table:\r\n"
MSG.GSYMBOL >CSTR "$%H%H:%S"

View File

@ -202,7 +202,7 @@ VSDRIVE.Ping ldx DRV+2 DRV.Slotn0
and #SSC.STATUS.RDRF incoming char?
bne .6
jsr VSDRIVE.Wait
* jsr VSDRIVE.Wait
jsr VSDRIVE.IncTimer
bne .5