Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-03-03 17:44:52 +01:00
parent 390a12c1dc
commit d0ec5bfb2c
14 changed files with 85 additions and 46 deletions

Binary file not shown.

View File

@ -372,13 +372,13 @@ DIR.HS jsr SRC.GetNextCharNB
cmp #'.'
bne .99
.22 sta DIR.Byte
.22 lda DIR.Byte
jsr OUT.EmitByte
bcc .5
rts
.3 pha
sta DIR.Byte
lda DIR.Byte
asl
asl
asl

View File

@ -44,6 +44,7 @@ EXP.Eval.Next stz SRC.ACC.F
stz SRC.ACC+1
stz SRC.ACC+2
stz SRC.ACC+3
jsr SRC.GetChar
bcs EXP.Eval.Missing
@ -71,8 +72,6 @@ EXP.Eval.Next stz SRC.ACC.F
jsr SYM.PC2Acc
lda #"*"
* jsr OUT.DEBUG
jsr SRC.GetNextChar
jmp EXP.EvalOperator

View File

@ -335,11 +335,12 @@ MAC.ReadLine >LDA.G MAC.hBuf
.9 lda #E.SYNTAX.ERROR
sec
MAC.ReadLine.RTS
rts
*---------------------------------------
MAC.Push >LDA.G MAC.StkPtr
cmp #MA.MAXDEPTH*6
beq .9
beq MAC.ReadLine.RTS
>LDA.G MAC.CtxID
pha
@ -364,12 +365,31 @@ MAC.Push >LDA.G MAC.StkPtr
ldx #0
.1 ldy #$ff
stz DIR.Byte between " flag
.2 iny
lda (ZPPtr2),y
beq .3
cmp #','
cmp #C.SPACE
bne .21
bit DIR.Byte
bne .2
lda #0
sta (ZPPtr2),y
bra .3
.21 cmp #'"'
bne .22
lda DIR.Byte
eor #$ff
sta DIR.Byte
bra .2
.22 cmp #','
bne .2
lda #0

View File

@ -330,8 +330,6 @@ OUT.DEBUG phy
ply
rts
*---------------------------------------
MAN
SAVE USR/SRC/BIN/ASM.S.OUT
LOAD USR/SRC/BIN/ASM.S

View File

@ -123,9 +123,12 @@ SRC.ParseLine.OpCode
>STYA ZPOpDefPtr
.1 lda (ZPOpDefPtr) End Of OpCode List
ldy #1
ora (ZPOpDefPtr),y
beq .9
lda ZPOpDefPtr
clc
adc #2
@ -135,35 +138,48 @@ SRC.ParseLine.OpCode
sta ZPPtr2+1
lda (ZPPtr2)
tax
ldy #0
.2 lda (ZPLinePtr),y
beq .7
cmp #'a'
bcc .3
cmp #'z'+1
bcs .3
eor #$20
.3 iny
cmp (ZPPtr2),y
bne .7
dex
bne .2
lda (ZPLinePtr),y
beq .8 End of Line, no AM
cmp #C.SPACE A space after opcode ?
bne .7
tya
sec skip OP + ' '
adc ZPLinePtr
sta ZPLinePtr
bcc .5
inc ZPLinePtr+1
.5 jsr SRC.GetChar
bcs .8 Nothing after OP ' '
cmp #C.SPACE OP ' ' ?
beq .8
bra SRC.ParseLine.AM
.7 lda ZPOpDefPtr
clc
adc (ZPOpDefPtr)
@ -174,10 +190,12 @@ SRC.ParseLine.OpCode
stx ZPOpDefPtr
sta ZPOpDefPtr+1
bra .1
.8 lda #$ff
>STA.G SRC.AMID
jsr SRC.ParseLine.AMCheck4OP
bcs .99
jmp SRC.ParseLine.Emit
.9 lda #E.INV.OPCODE
sec
@ -222,10 +240,13 @@ SRC.ParseLine.AM
jsr SRC.AddToBuf
.75 ldx SRC.ACC.SIZE
bne .73
>DEBUG
ldx #2 FWREF ...assume 2 bytes...
.73 lda SRC.ACC-1,x
beq * SHOULD NEVER APPEND
* bne .73
* >DEBUG
* ldx #2 FWREF ...assume 2 bytes...
.73 lda SRC.ACC-1,x select shorter address
bne .72
dex
@ -307,31 +328,38 @@ SRC.ParseLine.AMCheck
SRC.ParseLine.AMCheck4OP
lda ZPOpDefPtr Skip nextLoHi,L,"ADC"
ldx ZPOpDefPtr+1
clc
adc #2 Skip nextLoHi
bcc .11
inx
.11 sec skip LEN Byte
ldy #2 LEN Byte
adc (ZPOpDefPtr),y
bcc .10
inx
.10 sta ZPPtr1
stx ZPPtr1+1
lda (ZPPtr1) AMID...
.1 >CMP.G SRC.AMID
beq .8
lda ZPPtr1 Skip AMID,L,"39aa"
ldx ZPPtr1+1
inc AMID....
bne .12
inx
.12 sec LEN byte...
ldy #1 String...
adc (ZPPtr1),y
bcc .2
inx
.2 sta ZPPtr1
stx ZPPtr1+1
lda (ZPPtr1)
@ -340,6 +368,7 @@ SRC.ParseLine.AMCheck4OP
lda #E.INV.AM.4.OC
sec
rts
.8 >LDYA ZPPtr1
>STYA ZPOpDefPtr
clc
@ -351,7 +380,9 @@ SRC.ParseLine.Emit
ldy #1
lda (ZPOpDefPtr),y
sta SRC.ACCTMP+1 Char Count in AM
iny
.4 lda (ZPOpDefPtr),y
cmp #'a
bcs .5 lowercase, go compute address
@ -513,9 +544,6 @@ SRC.ComputeRel16
*---------------------------------------
SRC.ComputeRel phy
lda #'r'
* jsr OUT.DEBUG
ldy #ASM.PC
clc
lda SRC.ACC
@ -534,10 +562,6 @@ SRC.ComputeRel phy
sbc (pData),y
sta SRC.ACC+3
php
lda #'R'
* jsr OUT.DEBUG
plp
ply
rts
*---------------------------------------

View File

@ -158,17 +158,16 @@ SYM.LookupGlobal
>PUSHWI SYMG Get only Global value
>PUSHWZ Start
>SYSCALL SListGetData
php
pha
lda #'G'
* jsr OUT.DEBUG
pla
plp
rts
.4 >LDA.G ASM.PASS pass#2?
bne .9 yes, undefined symbol
lda #$ff
sta SRC.ACC
sta SRC.ACC+1 setup ACC=$FFFF to reserve 2 bytes in AM
.5 jsr SRC.GetNextChar
bcs .8

View File

@ -279,18 +279,19 @@ CS.DOEVENT sec
CS.RUN.CheckOpt ldy #1
lda (ZPPtr1),y
ldx #OptionVars-OptionList-1
ldy #OptionVars-OptionList-1
.2 cmp OptionList,x
.2 cmp OptionList,y
beq .3
dex
dey
bpl .2
sec
rts
.3 ldy OptionVars,x
.3 ldx OptionVars,y
lda #$ff
sta 0,y
sta 0,x
clc
rts
*--------------------------------------

View File

@ -3,7 +3,7 @@ NEW
.LIST OFF
.OP 65C02
.OR $2000
.TF BIN/CUT
.TF bin/cut
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I

View File

@ -1,10 +1,9 @@
NEW
PREFIX
AUTO 4,1
AUTO 3,1
.LIST OFF
.OP 65C02
.OR $2000
.TF BIN/GREP
.TF bin/grep
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
@ -150,11 +149,10 @@ CS.RUN.LOOP >SLEEP
.99 sec
rts
*--------------------------------------
CS.RUN.OPEN pha
>PUSHWZ Aux type
>PUSHBI S.FI.T.TXT
CS.RUN.OPEN >PUSHYA
>PUSHBI O.RDONLY+O.TEXT
pla
>PUSHBI S.FI.T.TXT
>PUSHWZ Aux type
>SYSCALL FOpen
bcs .9
sta hFile

View File

@ -291,7 +291,7 @@ CS.RUN.PRINT.DIR
cpy #19
bcs .2
lda #' '
lda #C.SPACE
phy
>SYSCALL PutChar
ply

View File

@ -217,7 +217,7 @@ CS.RUN ldy #S.PS.hStdIn
bcs CS.RUN.NEXT no match, skip....
.4 ldy #S.STAT.MODE+1
lda (ZPFileStat),y
and #$70
and #$70
bne .5 REG file ?
jsr CS.RUN.BuildFilePath
@ -688,7 +688,7 @@ CS.QUIT jsr LeaveSubDir
.1 ldy #hDstFullPath
jsr .7
ldy #hDstFilename
ldy #hDstFileName
jsr .7
.FIN

View File

@ -46,7 +46,7 @@ ExcludeMatch sec
bne .10
>LDYA ZPPtr2 ... so CI compare
>SYSCALL strupr
>SYSCALL StrUpr
.10 lda (ZPPtr2) Get first pattern byte
beq .8 Match always if empty
@ -197,7 +197,7 @@ InitSrcDirYA >PUSHYA
adc #0
sta ZPPtr2+1
>SYSCALL strdup
>SYSCALL StrDup
bcs .9
txa
>STA.G hFilter
@ -283,7 +283,7 @@ InitDstDirYA >PUSHYA
adc #0
sta ZPPtr2+1
>SYSCALL strdup
>SYSCALL StrDup
bcs .9
txa
>STA.G hDstFileName

View File

@ -274,7 +274,7 @@ SLISTX.SListLookup
.9 rts
*--------------------------------------
SLISTX.SListFree
sta .8+1
pha
jsr K.GetMemPtr
>STYA .1+1
@ -288,7 +288,7 @@ SLISTX.SListFree
inx
bra .1
.8 lda #$ff SELF MODIFIED
.8 pla
jmp K.FreeMem
*--------------------------------------
SLISTX.SListNew >LDYAI 128 32k Max before out of memory!!!