mirror of
https://github.com/A2osX/A2osX.git
synced 2024-06-14 02:29:33 +00:00
Kernel 0.94
This commit is contained in:
parent
390a12c1dc
commit
d0ec5bfb2c
Binary file not shown.
|
@ -372,13 +372,13 @@ DIR.HS jsr SRC.GetNextCharNB
|
||||||
cmp #'.'
|
cmp #'.'
|
||||||
bne .99
|
bne .99
|
||||||
|
|
||||||
.22 sta DIR.Byte
|
.22 lda DIR.Byte
|
||||||
jsr OUT.EmitByte
|
jsr OUT.EmitByte
|
||||||
bcc .5
|
bcc .5
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.3 pha
|
.3 pha
|
||||||
sta DIR.Byte
|
lda DIR.Byte
|
||||||
asl
|
asl
|
||||||
asl
|
asl
|
||||||
asl
|
asl
|
||||||
|
|
|
@ -44,6 +44,7 @@ EXP.Eval.Next stz SRC.ACC.F
|
||||||
stz SRC.ACC+1
|
stz SRC.ACC+1
|
||||||
stz SRC.ACC+2
|
stz SRC.ACC+2
|
||||||
stz SRC.ACC+3
|
stz SRC.ACC+3
|
||||||
|
|
||||||
jsr SRC.GetChar
|
jsr SRC.GetChar
|
||||||
bcs EXP.Eval.Missing
|
bcs EXP.Eval.Missing
|
||||||
|
|
||||||
|
@ -71,8 +72,6 @@ EXP.Eval.Next stz SRC.ACC.F
|
||||||
|
|
||||||
jsr SYM.PC2Acc
|
jsr SYM.PC2Acc
|
||||||
|
|
||||||
lda #"*"
|
|
||||||
* jsr OUT.DEBUG
|
|
||||||
jsr SRC.GetNextChar
|
jsr SRC.GetNextChar
|
||||||
jmp EXP.EvalOperator
|
jmp EXP.EvalOperator
|
||||||
|
|
||||||
|
|
|
@ -335,11 +335,12 @@ MAC.ReadLine >LDA.G MAC.hBuf
|
||||||
|
|
||||||
.9 lda #E.SYNTAX.ERROR
|
.9 lda #E.SYNTAX.ERROR
|
||||||
sec
|
sec
|
||||||
|
MAC.ReadLine.RTS
|
||||||
rts
|
rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
MAC.Push >LDA.G MAC.StkPtr
|
MAC.Push >LDA.G MAC.StkPtr
|
||||||
cmp #MA.MAXDEPTH*6
|
cmp #MA.MAXDEPTH*6
|
||||||
beq .9
|
beq MAC.ReadLine.RTS
|
||||||
|
|
||||||
>LDA.G MAC.CtxID
|
>LDA.G MAC.CtxID
|
||||||
pha
|
pha
|
||||||
|
@ -364,12 +365,31 @@ MAC.Push >LDA.G MAC.StkPtr
|
||||||
ldx #0
|
ldx #0
|
||||||
|
|
||||||
.1 ldy #$ff
|
.1 ldy #$ff
|
||||||
|
|
||||||
|
stz DIR.Byte between " flag
|
||||||
|
|
||||||
.2 iny
|
.2 iny
|
||||||
lda (ZPPtr2),y
|
lda (ZPPtr2),y
|
||||||
beq .3
|
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
|
bne .2
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
|
|
|
@ -330,8 +330,6 @@ OUT.DEBUG phy
|
||||||
ply
|
ply
|
||||||
rts
|
rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
|
|
||||||
|
|
||||||
MAN
|
MAN
|
||||||
SAVE USR/SRC/BIN/ASM.S.OUT
|
SAVE USR/SRC/BIN/ASM.S.OUT
|
||||||
LOAD USR/SRC/BIN/ASM.S
|
LOAD USR/SRC/BIN/ASM.S
|
||||||
|
|
|
@ -123,9 +123,12 @@ SRC.ParseLine.OpCode
|
||||||
>STYA ZPOpDefPtr
|
>STYA ZPOpDefPtr
|
||||||
|
|
||||||
.1 lda (ZPOpDefPtr) End Of OpCode List
|
.1 lda (ZPOpDefPtr) End Of OpCode List
|
||||||
|
|
||||||
ldy #1
|
ldy #1
|
||||||
|
|
||||||
ora (ZPOpDefPtr),y
|
ora (ZPOpDefPtr),y
|
||||||
beq .9
|
beq .9
|
||||||
|
|
||||||
lda ZPOpDefPtr
|
lda ZPOpDefPtr
|
||||||
clc
|
clc
|
||||||
adc #2
|
adc #2
|
||||||
|
@ -135,35 +138,48 @@ SRC.ParseLine.OpCode
|
||||||
sta ZPPtr2+1
|
sta ZPPtr2+1
|
||||||
lda (ZPPtr2)
|
lda (ZPPtr2)
|
||||||
tax
|
tax
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
|
|
||||||
.2 lda (ZPLinePtr),y
|
.2 lda (ZPLinePtr),y
|
||||||
beq .7
|
beq .7
|
||||||
|
|
||||||
cmp #'a'
|
cmp #'a'
|
||||||
bcc .3
|
bcc .3
|
||||||
|
|
||||||
cmp #'z'+1
|
cmp #'z'+1
|
||||||
bcs .3
|
bcs .3
|
||||||
|
|
||||||
eor #$20
|
eor #$20
|
||||||
|
|
||||||
.3 iny
|
.3 iny
|
||||||
cmp (ZPPtr2),y
|
cmp (ZPPtr2),y
|
||||||
bne .7
|
bne .7
|
||||||
|
|
||||||
dex
|
dex
|
||||||
bne .2
|
bne .2
|
||||||
|
|
||||||
lda (ZPLinePtr),y
|
lda (ZPLinePtr),y
|
||||||
beq .8 End of Line, no AM
|
beq .8 End of Line, no AM
|
||||||
|
|
||||||
cmp #C.SPACE A space after opcode ?
|
cmp #C.SPACE A space after opcode ?
|
||||||
bne .7
|
bne .7
|
||||||
|
|
||||||
tya
|
tya
|
||||||
sec skip OP + ' '
|
sec skip OP + ' '
|
||||||
adc ZPLinePtr
|
adc ZPLinePtr
|
||||||
sta ZPLinePtr
|
sta ZPLinePtr
|
||||||
bcc .5
|
bcc .5
|
||||||
inc ZPLinePtr+1
|
inc ZPLinePtr+1
|
||||||
|
|
||||||
.5 jsr SRC.GetChar
|
.5 jsr SRC.GetChar
|
||||||
bcs .8 Nothing after OP ' '
|
bcs .8 Nothing after OP ' '
|
||||||
|
|
||||||
cmp #C.SPACE OP ' ' ?
|
cmp #C.SPACE OP ' ' ?
|
||||||
beq .8
|
beq .8
|
||||||
|
|
||||||
bra SRC.ParseLine.AM
|
bra SRC.ParseLine.AM
|
||||||
|
|
||||||
.7 lda ZPOpDefPtr
|
.7 lda ZPOpDefPtr
|
||||||
clc
|
clc
|
||||||
adc (ZPOpDefPtr)
|
adc (ZPOpDefPtr)
|
||||||
|
@ -174,10 +190,12 @@ SRC.ParseLine.OpCode
|
||||||
stx ZPOpDefPtr
|
stx ZPOpDefPtr
|
||||||
sta ZPOpDefPtr+1
|
sta ZPOpDefPtr+1
|
||||||
bra .1
|
bra .1
|
||||||
|
|
||||||
.8 lda #$ff
|
.8 lda #$ff
|
||||||
>STA.G SRC.AMID
|
>STA.G SRC.AMID
|
||||||
jsr SRC.ParseLine.AMCheck4OP
|
jsr SRC.ParseLine.AMCheck4OP
|
||||||
bcs .99
|
bcs .99
|
||||||
|
|
||||||
jmp SRC.ParseLine.Emit
|
jmp SRC.ParseLine.Emit
|
||||||
.9 lda #E.INV.OPCODE
|
.9 lda #E.INV.OPCODE
|
||||||
sec
|
sec
|
||||||
|
@ -222,10 +240,13 @@ SRC.ParseLine.AM
|
||||||
jsr SRC.AddToBuf
|
jsr SRC.AddToBuf
|
||||||
|
|
||||||
.75 ldx SRC.ACC.SIZE
|
.75 ldx SRC.ACC.SIZE
|
||||||
bne .73
|
beq * SHOULD NEVER APPEND
|
||||||
>DEBUG
|
|
||||||
ldx #2 FWREF ...assume 2 bytes...
|
* bne .73
|
||||||
.73 lda SRC.ACC-1,x
|
* >DEBUG
|
||||||
|
* ldx #2 FWREF ...assume 2 bytes...
|
||||||
|
|
||||||
|
.73 lda SRC.ACC-1,x select shorter address
|
||||||
bne .72
|
bne .72
|
||||||
|
|
||||||
dex
|
dex
|
||||||
|
@ -307,31 +328,38 @@ SRC.ParseLine.AMCheck
|
||||||
SRC.ParseLine.AMCheck4OP
|
SRC.ParseLine.AMCheck4OP
|
||||||
lda ZPOpDefPtr Skip nextLoHi,L,"ADC"
|
lda ZPOpDefPtr Skip nextLoHi,L,"ADC"
|
||||||
ldx ZPOpDefPtr+1
|
ldx ZPOpDefPtr+1
|
||||||
|
|
||||||
clc
|
clc
|
||||||
adc #2 Skip nextLoHi
|
adc #2 Skip nextLoHi
|
||||||
bcc .11
|
bcc .11
|
||||||
inx
|
inx
|
||||||
|
|
||||||
.11 sec skip LEN Byte
|
.11 sec skip LEN Byte
|
||||||
ldy #2 LEN Byte
|
ldy #2 LEN Byte
|
||||||
adc (ZPOpDefPtr),y
|
adc (ZPOpDefPtr),y
|
||||||
bcc .10
|
bcc .10
|
||||||
inx
|
inx
|
||||||
|
|
||||||
.10 sta ZPPtr1
|
.10 sta ZPPtr1
|
||||||
|
|
||||||
stx ZPPtr1+1
|
stx ZPPtr1+1
|
||||||
lda (ZPPtr1) AMID...
|
lda (ZPPtr1) AMID...
|
||||||
|
|
||||||
.1 >CMP.G SRC.AMID
|
.1 >CMP.G SRC.AMID
|
||||||
beq .8
|
beq .8
|
||||||
|
|
||||||
lda ZPPtr1 Skip AMID,L,"39aa"
|
lda ZPPtr1 Skip AMID,L,"39aa"
|
||||||
ldx ZPPtr1+1
|
ldx ZPPtr1+1
|
||||||
inc AMID....
|
inc AMID....
|
||||||
bne .12
|
bne .12
|
||||||
inx
|
inx
|
||||||
|
|
||||||
.12 sec LEN byte...
|
.12 sec LEN byte...
|
||||||
ldy #1 String...
|
ldy #1 String...
|
||||||
adc (ZPPtr1),y
|
adc (ZPPtr1),y
|
||||||
bcc .2
|
bcc .2
|
||||||
inx
|
inx
|
||||||
|
|
||||||
.2 sta ZPPtr1
|
.2 sta ZPPtr1
|
||||||
stx ZPPtr1+1
|
stx ZPPtr1+1
|
||||||
lda (ZPPtr1)
|
lda (ZPPtr1)
|
||||||
|
@ -340,6 +368,7 @@ SRC.ParseLine.AMCheck4OP
|
||||||
lda #E.INV.AM.4.OC
|
lda #E.INV.AM.4.OC
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.8 >LDYA ZPPtr1
|
.8 >LDYA ZPPtr1
|
||||||
>STYA ZPOpDefPtr
|
>STYA ZPOpDefPtr
|
||||||
clc
|
clc
|
||||||
|
@ -351,7 +380,9 @@ SRC.ParseLine.Emit
|
||||||
ldy #1
|
ldy #1
|
||||||
lda (ZPOpDefPtr),y
|
lda (ZPOpDefPtr),y
|
||||||
sta SRC.ACCTMP+1 Char Count in AM
|
sta SRC.ACCTMP+1 Char Count in AM
|
||||||
|
|
||||||
iny
|
iny
|
||||||
|
|
||||||
.4 lda (ZPOpDefPtr),y
|
.4 lda (ZPOpDefPtr),y
|
||||||
cmp #'a
|
cmp #'a
|
||||||
bcs .5 lowercase, go compute address
|
bcs .5 lowercase, go compute address
|
||||||
|
@ -513,9 +544,6 @@ SRC.ComputeRel16
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
SRC.ComputeRel phy
|
SRC.ComputeRel phy
|
||||||
|
|
||||||
lda #'r'
|
|
||||||
* jsr OUT.DEBUG
|
|
||||||
|
|
||||||
ldy #ASM.PC
|
ldy #ASM.PC
|
||||||
clc
|
clc
|
||||||
lda SRC.ACC
|
lda SRC.ACC
|
||||||
|
@ -534,10 +562,6 @@ SRC.ComputeRel phy
|
||||||
sbc (pData),y
|
sbc (pData),y
|
||||||
sta SRC.ACC+3
|
sta SRC.ACC+3
|
||||||
|
|
||||||
php
|
|
||||||
lda #'R'
|
|
||||||
* jsr OUT.DEBUG
|
|
||||||
plp
|
|
||||||
ply
|
ply
|
||||||
rts
|
rts
|
||||||
*---------------------------------------
|
*---------------------------------------
|
||||||
|
|
|
@ -158,17 +158,16 @@ SYM.LookupGlobal
|
||||||
>PUSHWI SYMG Get only Global value
|
>PUSHWI SYMG Get only Global value
|
||||||
>PUSHWZ Start
|
>PUSHWZ Start
|
||||||
>SYSCALL SListGetData
|
>SYSCALL SListGetData
|
||||||
php
|
|
||||||
pha
|
|
||||||
lda #'G'
|
|
||||||
* jsr OUT.DEBUG
|
|
||||||
pla
|
|
||||||
plp
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.4 >LDA.G ASM.PASS pass#2?
|
.4 >LDA.G ASM.PASS pass#2?
|
||||||
bne .9 yes, undefined symbol
|
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
|
.5 jsr SRC.GetNextChar
|
||||||
bcs .8
|
bcs .8
|
||||||
|
|
||||||
|
|
|
@ -279,18 +279,19 @@ CS.DOEVENT sec
|
||||||
CS.RUN.CheckOpt ldy #1
|
CS.RUN.CheckOpt ldy #1
|
||||||
lda (ZPPtr1),y
|
lda (ZPPtr1),y
|
||||||
|
|
||||||
ldx #OptionVars-OptionList-1
|
ldy #OptionVars-OptionList-1
|
||||||
|
|
||||||
.2 cmp OptionList,x
|
.2 cmp OptionList,y
|
||||||
beq .3
|
beq .3
|
||||||
dex
|
dey
|
||||||
bpl .2
|
bpl .2
|
||||||
|
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
.3 ldy OptionVars,x
|
|
||||||
|
.3 ldx OptionVars,y
|
||||||
lda #$ff
|
lda #$ff
|
||||||
sta 0,y
|
sta 0,x
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
|
|
@ -3,7 +3,7 @@ NEW
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
.OP 65C02
|
.OP 65C02
|
||||||
.OR $2000
|
.OR $2000
|
||||||
.TF BIN/CUT
|
.TF bin/cut
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.INB INC/MACROS.I
|
.INB INC/MACROS.I
|
||||||
.INB INC/A2OSX.I
|
.INB INC/A2OSX.I
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
NEW
|
NEW
|
||||||
PREFIX
|
AUTO 3,1
|
||||||
AUTO 4,1
|
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
.OP 65C02
|
.OP 65C02
|
||||||
.OR $2000
|
.OR $2000
|
||||||
.TF BIN/GREP
|
.TF bin/grep
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.INB INC/MACROS.I
|
.INB INC/MACROS.I
|
||||||
.INB INC/A2OSX.I
|
.INB INC/A2OSX.I
|
||||||
|
@ -150,11 +149,10 @@ CS.RUN.LOOP >SLEEP
|
||||||
.99 sec
|
.99 sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
CS.RUN.OPEN pha
|
CS.RUN.OPEN >PUSHYA
|
||||||
>PUSHWZ Aux type
|
|
||||||
>PUSHBI S.FI.T.TXT
|
|
||||||
>PUSHBI O.RDONLY+O.TEXT
|
>PUSHBI O.RDONLY+O.TEXT
|
||||||
pla
|
>PUSHBI S.FI.T.TXT
|
||||||
|
>PUSHWZ Aux type
|
||||||
>SYSCALL FOpen
|
>SYSCALL FOpen
|
||||||
bcs .9
|
bcs .9
|
||||||
sta hFile
|
sta hFile
|
||||||
|
|
|
@ -291,7 +291,7 @@ CS.RUN.PRINT.DIR
|
||||||
cpy #19
|
cpy #19
|
||||||
bcs .2
|
bcs .2
|
||||||
|
|
||||||
lda #' '
|
lda #C.SPACE
|
||||||
phy
|
phy
|
||||||
>SYSCALL PutChar
|
>SYSCALL PutChar
|
||||||
ply
|
ply
|
||||||
|
|
|
@ -217,7 +217,7 @@ CS.RUN ldy #S.PS.hStdIn
|
||||||
bcs CS.RUN.NEXT no match, skip....
|
bcs CS.RUN.NEXT no match, skip....
|
||||||
.4 ldy #S.STAT.MODE+1
|
.4 ldy #S.STAT.MODE+1
|
||||||
lda (ZPFileStat),y
|
lda (ZPFileStat),y
|
||||||
and #$70
|
and #$70
|
||||||
bne .5 REG file ?
|
bne .5 REG file ?
|
||||||
|
|
||||||
jsr CS.RUN.BuildFilePath
|
jsr CS.RUN.BuildFilePath
|
||||||
|
@ -688,7 +688,7 @@ CS.QUIT jsr LeaveSubDir
|
||||||
.1 ldy #hDstFullPath
|
.1 ldy #hDstFullPath
|
||||||
jsr .7
|
jsr .7
|
||||||
|
|
||||||
ldy #hDstFilename
|
ldy #hDstFileName
|
||||||
jsr .7
|
jsr .7
|
||||||
.FIN
|
.FIN
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ ExcludeMatch sec
|
||||||
bne .10
|
bne .10
|
||||||
|
|
||||||
>LDYA ZPPtr2 ... so CI compare
|
>LDYA ZPPtr2 ... so CI compare
|
||||||
>SYSCALL strupr
|
>SYSCALL StrUpr
|
||||||
|
|
||||||
.10 lda (ZPPtr2) Get first pattern byte
|
.10 lda (ZPPtr2) Get first pattern byte
|
||||||
beq .8 Match always if empty
|
beq .8 Match always if empty
|
||||||
|
@ -197,7 +197,7 @@ InitSrcDirYA >PUSHYA
|
||||||
adc #0
|
adc #0
|
||||||
sta ZPPtr2+1
|
sta ZPPtr2+1
|
||||||
|
|
||||||
>SYSCALL strdup
|
>SYSCALL StrDup
|
||||||
bcs .9
|
bcs .9
|
||||||
txa
|
txa
|
||||||
>STA.G hFilter
|
>STA.G hFilter
|
||||||
|
@ -283,7 +283,7 @@ InitDstDirYA >PUSHYA
|
||||||
adc #0
|
adc #0
|
||||||
sta ZPPtr2+1
|
sta ZPPtr2+1
|
||||||
|
|
||||||
>SYSCALL strdup
|
>SYSCALL StrDup
|
||||||
bcs .9
|
bcs .9
|
||||||
txa
|
txa
|
||||||
>STA.G hDstFileName
|
>STA.G hDstFileName
|
||||||
|
|
|
@ -274,7 +274,7 @@ SLISTX.SListLookup
|
||||||
.9 rts
|
.9 rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
SLISTX.SListFree
|
SLISTX.SListFree
|
||||||
sta .8+1
|
pha
|
||||||
|
|
||||||
jsr K.GetMemPtr
|
jsr K.GetMemPtr
|
||||||
>STYA .1+1
|
>STYA .1+1
|
||||||
|
@ -288,7 +288,7 @@ SLISTX.SListFree
|
||||||
inx
|
inx
|
||||||
bra .1
|
bra .1
|
||||||
|
|
||||||
.8 lda #$ff SELF MODIFIED
|
.8 pla
|
||||||
jmp K.FreeMem
|
jmp K.FreeMem
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
SLISTX.SListNew >LDYAI 128 32k Max before out of memory!!!
|
SLISTX.SListNew >LDYAI 128 32k Max before out of memory!!!
|
||||||
|
|
Loading…
Reference in New Issue
Block a user