ASM: fix forward ref bug

This commit is contained in:
burniouf 2023-07-22 15:43:25 +02:00
parent e3246c9c83
commit 9c547bcd35
4 changed files with 47 additions and 47 deletions

View File

@ -18,7 +18,7 @@ FIO.Init >LDYAI 256
>STYA ZPTmpBuf
txa
>STA.G SRC.hTmpBuf
>LDYA L.ASM.6502
FIO.LOAD.CPU >STYA ZPPtr2
@ -29,7 +29,7 @@ FIO.LOAD.CPU >STYA ZPPtr2
>STYA ZPPtr1
ldy #$ff
ldx #$ff
.1 iny
inx
lda (ZPPtr1),y
@ -45,24 +45,24 @@ FIO.LOAD.CPU >STYA ZPPtr2
lda (ZPPtr2),y
jsr SRC.IsLetterOrDigit
bcs .3
sta ASM.CPU.FILE,x
bra .2
.3 stz ASM.CPU.FILE,x
>LDA.G ASM.hCPUFILE
beq .4
>SYSCALL FreeMem
>STZ.G ASM.hCPUFILE
.4 >PUSHW L.MSG.CPU.FILE
>PUSHW L.ASM.CPU.FILE
>PUSHBI 2
jsr OUT.Print
>PUSHW L.ASM.CPU.FILE
>PUSHBI O.RDONLY
>PUSHBI S.FI.T.BIN
@ -72,7 +72,7 @@ FIO.LOAD.CPU >STYA ZPPtr2
txa
>STA.G ASM.hCPUFILE
>SYSCALL GetMemPtr
>STYA ZPPtr1
@ -110,20 +110,20 @@ FIO.OpenFile >STYA ZPPtr1
>PUSHW ZPPtr1
>PUSHBI 2
jsr OUT.Print
>LDA.G SRC.Depth
cmp #IN.MAXDEPTH
bne .1
lda #E.SRC.TOO.MANY.IN
sec
rts
.1 >PUSHW ZPPtr1
>PUSHW ZPTmpBuf
>SYSCALL Stat
bcs .99
ldy #S.STAT.P.TYPE
lda (ZPTmpBuf),y
cmp #S.FI.T.TXT
@ -131,12 +131,12 @@ FIO.OpenFile >STYA ZPPtr1
ldx #O.RDONLY+O.TEXT
bra .3
.2 cmp #$FA S-C/BAS?
bne .98
ldx #O.RDONLY
.3 >PUSHW ZPPtr1
txa
>PUSHA
@ -146,10 +146,10 @@ FIO.OpenFile >STYA ZPPtr1
>PUSHWZ
>SYSCALL FOpen
bcs .99
pha
>INC.G SRC.Depth
clc
adc #SRC.hFILES-1
tay
@ -170,10 +170,10 @@ FIO.OpenFile >STYA ZPPtr1
>STA.G SRC.LINENUM
iny
sta (pData),y
clc
rts
.98 lda #E.SRC.INV.TYPE
sec
.99 rts
@ -189,7 +189,7 @@ FIO.ReadLine >LDA.G SRC.Depth
>PUSHW ZPLineBuf
>PUSHWI 256
jsr FIO.ReadFromFile
bcs .19
bcs .19
tya
beq .13
@ -214,7 +214,7 @@ FIO.ReadLine >LDA.G SRC.Depth
>PUSHW ZPTmpBuf
>PUSHWI 3
jsr FIO.ReadFromFile
bcs .19
bcs .19
ldy #1
lda (ZPTmpBuf),y
@ -231,7 +231,7 @@ FIO.ReadLine >LDA.G SRC.Depth
lda #0 LENHI = 0
>PUSHA
lda (ZPTmpBuf) LEN
sec
sbc #3
@ -327,16 +327,16 @@ FIO.ReadFromFile
*---------------------------------------
FIO.FileClose >LDA.G SRC.Depth
beq .8
dec
sta (pData),y
sec
adc #SRC.hFILES-1
tay
lda (pData),y
>SYSCALL FClose
.8 clc
rts
*---------------------------------------

View File

@ -566,17 +566,17 @@ SRC.ComputeRel phy
lda #0
adc (pData),y
sta SRC.ARG+1
iny
lda #0
adc (pData),y
sta SRC.ARG+2
iny
lda #0
adc (pData),y
sta SRC.ARG+3
sec
lda SRC.ACC
sbc SRC.ARG
@ -595,7 +595,7 @@ SRC.ComputeRel phy
sta SRC.ACC+3
ply
rts
rts
*---------------------------------------
SRC.GetDecimal8 jsr SRC.GetDecimal
bcs .9
@ -975,7 +975,7 @@ SRC.IsLetter cmp #'_'
cmp #'z'+1
rts CC if lowercase
.8 clc
rts
@ -1041,7 +1041,7 @@ SRC.SkipXp1 sec
bcc .8
inc ZPLinePtr+1
.8 rts
*---------------------------------------
SRC.GetNextCharNB
@ -1137,7 +1137,7 @@ SRC.GetACCSize lda SRC.ACC.F
.1 ldx SRC.ACC.SIZE
beq * SHOULD NEVER APPEND
.2 lda SRC.ACC-1,x
bne .8

View File

@ -80,7 +80,7 @@ SYM.NewGlobal >LDA.G ASM.PASS
sta (ZPSymbolBuf),y
phx
jsr SYM.LookupFWFef
bcs .1
@ -125,11 +125,11 @@ SYM.GetGlobal >PUSHB.G SYM.hList Pass #2: should be already defined...
lda (ZPSymbolBuf) #SYMG.F
bit #SYMG.F.EQU
bne .8
* bit #SYMG.F.FWREF
* beq .2
* >DEBUG
* >DEBUG
.2 >LDA.G ASM.PC
ldy #SYMG.V
@ -178,7 +178,7 @@ SYM.LookupGlobal
lda #$FF
sta SRC.ACC
sta SRC.ACC+1
jmp SYM.AddFWFef
.10 >STYA ZPPtr1 KeyID
@ -571,7 +571,7 @@ SYM.Dump.G ldx #8
.10 lda (ZPSymbolBuf),y
bne .1
dey
dex
dex
@ -580,7 +580,7 @@ SYM.Dump.G ldx #8
.1 txa
lsr
pha
>PUSHB L.MSG.EQU0+1,x
>PUSHB L.MSG.EQU0,x
@ -589,7 +589,7 @@ SYM.Dump.G ldx #8
pha
tax byte count
clc
adc #SYMG.V
@ -628,7 +628,7 @@ SYM.Dump.LP ldy #SYMG
>PUSHW L.MSG.LSYMBOL
txa
>PUSHA
* >DEBUG
jsr SYM.Dump.PushValueY
lda #5

View File

@ -211,7 +211,7 @@ CS.RUN.SETUP
.7 jsr DHCP.RUN
bcc .8
dec RetryCount
bne .7
@ -230,13 +230,13 @@ CS.RUN.SETUP.RTS
rts
*--------------------------------------
CS.RUN.DUMP >LEA.G DCB.NIC
ldx #S.IOCTL.S.GETDCB
jsr CS.RUN.IOCTL
bcs CS.RUN.SETUP.RTS
>LEA.G DIB
ldx #S.IOCTL.S.GETDIB
jsr CS.RUN.IOCTL
bcs CS.RUN.SETUP.RTS
@ -247,7 +247,7 @@ CS.RUN.DUMPNIC >PUSHW L.MSG1.DEV
>PUSHA
>SYSCALL GetMemPtr
pha
tya
clc