2019-09-01 04:54:20 +00:00
|
|
|
;Edited to have duplicate labels (PROJ_ZERO, DPCODE).
|
2019-09-01 03:32:43 +00:00
|
|
|
!cpu 65816
|
2019-10-10 20:49:21 +00:00
|
|
|
CONST_ZERO = $f0 ;project const
|
2019-10-23 05:43:10 +00:00
|
|
|
|
2019-09-01 03:32:43 +00:00
|
|
|
PROJ_ZERO = $00 ;project addr
|
|
|
|
PROJ_ONE = $01 ;project addr
|
|
|
|
|
2020-05-14 23:37:33 +00:00
|
|
|
* = $0000
|
|
|
|
!pseudopc $1000 {
|
2019-09-01 03:32:43 +00:00
|
|
|
!as
|
|
|
|
!rs
|
|
|
|
ldy PROJ_ZERO
|
|
|
|
lda (PROJ_ONE),y
|
2019-09-15 21:19:45 +00:00
|
|
|
sta $03 ;could be PROJ_ONE+2, but "nearby" is off
|
2019-09-01 03:32:43 +00:00
|
|
|
ldx $04
|
|
|
|
lda CONST_ZERO,S
|
|
|
|
sta $f1,S
|
2019-09-01 17:55:19 +00:00
|
|
|
!zone Z00000c
|
|
|
|
.VAR_ZERO = $00
|
|
|
|
.VAR_TWO = $02
|
|
|
|
.VAR_THREE = $03
|
|
|
|
.CONST_ZERO_VAR = $f0
|
|
|
|
ldy .VAR_ZERO
|
|
|
|
lda (.VAR_ZERO+1),y
|
|
|
|
sta .VAR_THREE
|
2019-09-01 03:32:43 +00:00
|
|
|
ldx $04
|
2019-09-01 17:55:19 +00:00
|
|
|
lda .CONST_ZERO_VAR,S
|
2019-09-01 03:32:43 +00:00
|
|
|
sta $f1,S
|
|
|
|
eor 0
|
|
|
|
ora 240,S
|
2019-09-01 17:55:19 +00:00
|
|
|
!zone Z00001c
|
|
|
|
.VAR_ZERO = $00
|
|
|
|
.VAR_TWO = $02
|
|
|
|
.VAR_THREE = $03
|
Fix various local variable de-duplication bugs
In 1.5.0-dev1, as part of changes to the way label localization
works, the local variable de-duplicator started checking against a
filtered copy of the symbol table. Unfortunately it never
re-generated the table, so a long-lived LocalVariableLookup (like
the one used by LineListGen) would set up the dup map wrong and
be inconsistent with other parts of the program.
We now regenerate the table on every Reset().
The de-duplication stuff also had problems when opcodes and
operands were double-clicked on. When the opcode is clicked, the
selection should jump to the appropriate variable declaration, but
it wasn't being found because the label generated in the list was
in its original form. Fixed.
When an instruction operand is double-clicked, the instruction operand
editor opens with an "edit variable" shortcut. This was showing
the de-duplicated name, which isn't necessarily a bad thing, but it
was passing that value on to the DefSymbol editor, which thought it
was being asked to create a new entry. Fixed. (Entering the editor
through the LvTable editor works correctly, with nary a de-duplicated
name in sight. You'll be forced to rename it because it'll fail the
uniqueness test.)
References to de-duplicated local variables were getting lost when
the symbol's label was replaced (due largely to a convenient but
flawed shortcut: xrefs are attached to DefSymbol objects). Fixed by
linking the XrefSets.
Given the many issues and their relative subtlety, I decided to make
the modified names more obvious, and went back to the "_DUPn" naming
strategy. (I'm also considering just making it an error and
discarding conflicting entries during analysis... this is much more
complicated than I expected it to be.)
Quick tests can be performed in 2019-local-variables:
- go to +000026, double-click on the opcode, confirm sel change
- go to +000026, double-click on the operand, confirm orig name
shown in shortcut and that shortcut opens editor with orig name
- go to +00001a, down a line, click on PROJ_ZERO_DUP1 and confirm
that it has a single reference (from +000026)
- double-click on var table and confirm editing entry
2020-01-14 01:54:47 +00:00
|
|
|
.PROJ_ZERO_DUP1 = $10 ;clash with project symbol
|
|
|
|
.DPCODE_DUP1 = $80 ;clash with user label
|
2019-09-01 17:55:19 +00:00
|
|
|
.CONST_ZERO_VAR = $f0
|
|
|
|
lda .VAR_ZERO
|
|
|
|
lda .VAR_ZERO+1
|
|
|
|
lda .VAR_TWO
|
|
|
|
!zone Z000022
|
|
|
|
.VAR_ZERO = $00
|
|
|
|
.VAR_TWO = $02
|
|
|
|
.VAR_THREE = $03
|
Fix various local variable de-duplication bugs
In 1.5.0-dev1, as part of changes to the way label localization
works, the local variable de-duplicator started checking against a
filtered copy of the symbol table. Unfortunately it never
re-generated the table, so a long-lived LocalVariableLookup (like
the one used by LineListGen) would set up the dup map wrong and
be inconsistent with other parts of the program.
We now regenerate the table on every Reset().
The de-duplication stuff also had problems when opcodes and
operands were double-clicked on. When the opcode is clicked, the
selection should jump to the appropriate variable declaration, but
it wasn't being found because the label generated in the list was
in its original form. Fixed.
When an instruction operand is double-clicked, the instruction operand
editor opens with an "edit variable" shortcut. This was showing
the de-duplicated name, which isn't necessarily a bad thing, but it
was passing that value on to the DefSymbol editor, which thought it
was being asked to create a new entry. Fixed. (Entering the editor
through the LvTable editor works correctly, with nary a de-duplicated
name in sight. You'll be forced to rename it because it'll fail the
uniqueness test.)
References to de-duplicated local variables were getting lost when
the symbol's label was replaced (due largely to a convenient but
flawed shortcut: xrefs are attached to DefSymbol objects). Fixed by
linking the XrefSets.
Given the many issues and their relative subtlety, I decided to make
the modified names more obvious, and went back to the "_DUPn" naming
strategy. (I'm also considering just making it an error and
discarding conflicting entries during analysis... this is much more
complicated than I expected it to be.)
Quick tests can be performed in 2019-local-variables:
- go to +000026, double-click on the opcode, confirm sel change
- go to +000026, double-click on the operand, confirm orig name
shown in shortcut and that shortcut opens editor with orig name
- go to +00001a, down a line, click on PROJ_ZERO_DUP1 and confirm
that it has a single reference (from +000026)
- double-click on var table and confirm editing entry
2020-01-14 01:54:47 +00:00
|
|
|
.PROJ_ZERO_DUP1 = $10 ;clash with project symbol
|
|
|
|
.DPCODE_DUP1 = $80 ;clash with user label
|
2019-09-01 17:55:19 +00:00
|
|
|
.CONST_ZERO_VAR = $f0
|
|
|
|
lda .VAR_THREE
|
2019-09-01 03:32:43 +00:00
|
|
|
lda $04
|
Fix various local variable de-duplication bugs
In 1.5.0-dev1, as part of changes to the way label localization
works, the local variable de-duplicator started checking against a
filtered copy of the symbol table. Unfortunately it never
re-generated the table, so a long-lived LocalVariableLookup (like
the one used by LineListGen) would set up the dup map wrong and
be inconsistent with other parts of the program.
We now regenerate the table on every Reset().
The de-duplication stuff also had problems when opcodes and
operands were double-clicked on. When the opcode is clicked, the
selection should jump to the appropriate variable declaration, but
it wasn't being found because the label generated in the list was
in its original form. Fixed.
When an instruction operand is double-clicked, the instruction operand
editor opens with an "edit variable" shortcut. This was showing
the de-duplicated name, which isn't necessarily a bad thing, but it
was passing that value on to the DefSymbol editor, which thought it
was being asked to create a new entry. Fixed. (Entering the editor
through the LvTable editor works correctly, with nary a de-duplicated
name in sight. You'll be forced to rename it because it'll fail the
uniqueness test.)
References to de-duplicated local variables were getting lost when
the symbol's label was replaced (due largely to a convenient but
flawed shortcut: xrefs are attached to DefSymbol objects). Fixed by
linking the XrefSets.
Given the many issues and their relative subtlety, I decided to make
the modified names more obvious, and went back to the "_DUPn" naming
strategy. (I'm also considering just making it an error and
discarding conflicting entries during analysis... this is much more
complicated than I expected it to be.)
Quick tests can be performed in 2019-local-variables:
- go to +000026, double-click on the opcode, confirm sel change
- go to +000026, double-click on the operand, confirm orig name
shown in shortcut and that shortcut opens editor with orig name
- go to +00001a, down a line, click on PROJ_ZERO_DUP1 and confirm
that it has a single reference (from +000026)
- double-click on var table and confirm editing entry
2020-01-14 01:54:47 +00:00
|
|
|
lda .PROJ_ZERO_DUP1
|
2019-09-01 03:32:43 +00:00
|
|
|
lda $11
|
|
|
|
lda+1 DPCODE
|
2019-09-01 17:55:19 +00:00
|
|
|
!zone Z00002c
|
2019-09-01 03:32:43 +00:00
|
|
|
ldx PROJ_ZERO
|
|
|
|
ldx PROJ_ONE
|
|
|
|
ldx $02
|
|
|
|
bit $ffa9
|
|
|
|
ldy PROJ_ZERO
|
|
|
|
ldy PROJ_ONE
|
|
|
|
ldy $02
|
|
|
|
!byte $2c
|
2019-09-01 17:55:19 +00:00
|
|
|
!zone Z00003c
|
|
|
|
.NH0 = $00 ;not hidden
|
|
|
|
.NH1 = $01 ;not hidden
|
2019-09-01 03:32:43 +00:00
|
|
|
L103C lda #$fe
|
|
|
|
beq L103C
|
2019-09-01 17:55:19 +00:00
|
|
|
ldy .NH0
|
|
|
|
ldy .NH1
|
2019-09-01 03:32:43 +00:00
|
|
|
ldy $02
|
|
|
|
nop
|
2019-09-01 17:55:19 +00:00
|
|
|
!zone Z000047
|
|
|
|
.NH0 = $00 ;not hidden
|
|
|
|
.NH1 = $01 ;not hidden
|
|
|
|
.PTR0 = $10
|
|
|
|
.CONST0 = $10
|
|
|
|
lda .PTR0
|
|
|
|
ldx .PTR0+1
|
2019-09-01 03:32:43 +00:00
|
|
|
ldy $12
|
2019-09-01 17:55:19 +00:00
|
|
|
lda (.CONST0,S),y
|
|
|
|
sta (.CONST0+3,S),y
|
2019-09-01 03:32:43 +00:00
|
|
|
;Test name redefinition. This is mostly of interest for assemblers without
|
|
|
|
;redefinable variables, but also of interest to the cross-reference window.
|
2019-09-01 17:55:19 +00:00
|
|
|
!zone Z000051
|
|
|
|
.NH0 = $00 ;not hidden
|
|
|
|
.NH1 = $01 ;not hidden
|
|
|
|
.PTR0 = $10
|
|
|
|
.CONST0 = $10
|
|
|
|
.PTR = $20 ;#1
|
|
|
|
ldx .PTR
|
|
|
|
!zone Z000053
|
|
|
|
.NH0 = $00 ;not hidden
|
|
|
|
.NH1 = $01 ;not hidden
|
|
|
|
.PTR0 = $10
|
|
|
|
.CONST0 = $10
|
|
|
|
.PTR = $22 ;#2
|
|
|
|
ldx .PTR
|
|
|
|
!zone Z000055
|
|
|
|
.NH0 = $00 ;not hidden
|
|
|
|
.NH1 = $01 ;not hidden
|
|
|
|
.PTR0 = $10
|
|
|
|
.CONST0 = $10
|
|
|
|
.PTR = $24 ;#3
|
|
|
|
ldx .PTR
|
2019-09-20 21:05:17 +00:00
|
|
|
@PTR_1 nop
|
2019-09-01 17:55:19 +00:00
|
|
|
!zone Z000058
|
|
|
|
.NH0 = $00 ;not hidden
|
|
|
|
.NH1 = $01 ;not hidden
|
|
|
|
.PTR0 = $10
|
|
|
|
.CONST0 = $10
|
|
|
|
.PTR_A = $20
|
|
|
|
.PTR = $24 ;#3
|
|
|
|
ldy .PTR_A
|
|
|
|
!zone Z00005a
|
|
|
|
.NH0 = $00 ;not hidden
|
|
|
|
.NH1 = $01 ;not hidden
|
|
|
|
.PTR0 = $10
|
|
|
|
.CONST0 = $10
|
|
|
|
.PTR_B = $1f
|
|
|
|
.PTR = $24 ;#3
|
|
|
|
ldy .PTR_B+1
|
|
|
|
!zone Z00005c
|
|
|
|
.NH0 = $00 ;not hidden
|
|
|
|
.NH1 = $01 ;not hidden
|
|
|
|
.PTR0 = $10
|
|
|
|
.CONST0 = $10
|
|
|
|
.PTR_C = $1d
|
|
|
|
.PTR = $24 ;#3
|
|
|
|
ldy .PTR_C+3
|
|
|
|
!zone Z00005e
|
|
|
|
.NH0 = $00 ;not hidden
|
|
|
|
.NH1 = $01 ;not hidden
|
|
|
|
.PTR0 = $10
|
|
|
|
.CONST0 = $10
|
|
|
|
.PTR_C = $1d
|
|
|
|
.PTR_D = $21
|
|
|
|
.PTR = $24 ;#3
|
|
|
|
ldy .PTR_C+3
|
|
|
|
!zone Z000060
|
|
|
|
.NH0 = $00 ;not hidden
|
|
|
|
.NH1 = $01 ;not hidden
|
|
|
|
.PTR0 = $10
|
|
|
|
.CONST0 = $10
|
|
|
|
.PTR_C = $1d
|
|
|
|
.PTR_D = $21
|
|
|
|
.PTR = $24 ;#3
|
|
|
|
.VAL0 = $30
|
|
|
|
.VAL1 = $31
|
|
|
|
.VAL2 = $32
|
|
|
|
.VAL3 = $33
|
|
|
|
.VAL4 = $34
|
|
|
|
.VAL5 = $35
|
|
|
|
and .VAL0
|
|
|
|
and .VAL1
|
|
|
|
and .VAL2
|
|
|
|
and .VAL3
|
|
|
|
and .VAL4
|
|
|
|
and .VAL5
|
|
|
|
!zone Z00006c
|
|
|
|
.NH0 = $00 ;not hidden
|
|
|
|
.NH1 = $01 ;not hidden
|
|
|
|
.PTR0 = $10
|
|
|
|
.CONST0 = $10
|
|
|
|
.PTR_C = $1d
|
|
|
|
.PTR_D = $21
|
|
|
|
.PTR = $24 ;#3
|
|
|
|
.VAL0 = $30
|
|
|
|
.VAL14 = $31
|
|
|
|
.VAL5 = $35
|
|
|
|
and .VAL0
|
|
|
|
and .VAL14
|
|
|
|
and .VAL14+1
|
|
|
|
and .VAL14+2
|
|
|
|
and .VAL14+3
|
|
|
|
and .VAL5
|
|
|
|
!zone Z000078
|
|
|
|
.NH0 = $00 ;not hidden
|
|
|
|
.NH1 = $01 ;not hidden
|
|
|
|
.PTR0 = $10
|
|
|
|
.CONST0 = $10
|
|
|
|
.PTR_C = $1d
|
|
|
|
.PTR_D = $21
|
|
|
|
.PTR = $24 ;#3
|
|
|
|
.VAL0 = $30
|
|
|
|
.VAL14 = $31
|
|
|
|
.VAL5 = $35
|
|
|
|
.DPNOP = $80 ;same as org
|
2019-09-01 03:32:43 +00:00
|
|
|
lda+1 DPCODE
|
|
|
|
jsr DPCODE
|
|
|
|
rts
|
|
|
|
|
2020-05-14 23:37:33 +00:00
|
|
|
} ;!pseudopc
|
2019-09-01 03:32:43 +00:00
|
|
|
!pseudopc $0080 {
|
|
|
|
DPCODE nop
|
|
|
|
lda+1 DPCODE
|
|
|
|
lda+2 DPCODE
|
|
|
|
lda+3 DPCODE
|
2019-09-20 21:05:17 +00:00
|
|
|
@SPLIT1 lda #','
|
|
|
|
!zone Z00008a
|
|
|
|
.NH0 = $00 ;not hidden
|
|
|
|
.NH1 = $01 ;not hidden
|
|
|
|
.PTR0 = $10
|
|
|
|
.CONST0 = $10
|
|
|
|
.PTR_C = $1d
|
|
|
|
.PTR_D = $21
|
|
|
|
.PTR = $24 ;#3
|
|
|
|
.VAL0 = $30
|
|
|
|
.VAL14 = $31
|
|
|
|
.VAL5 = $35
|
|
|
|
.SPLITTER = $80
|
|
|
|
ldx $1234
|
|
|
|
beq @SPLIT1
|
|
|
|
@SPLIT2 lda ','
|
|
|
|
!zone Z000091
|
|
|
|
.NH0 = $00 ;not hidden
|
|
|
|
.NH1 = $01 ;not hidden
|
|
|
|
.PTR0 = $10
|
|
|
|
.CONST0 = $10
|
|
|
|
.PTR_C = $1d
|
|
|
|
.PTR_D = $21
|
|
|
|
.PTR = $24 ;#3
|
|
|
|
.VAL0 = $30
|
|
|
|
.VAL14 = $31
|
|
|
|
.VAL5 = $35
|
|
|
|
.SPLITTER = $80
|
|
|
|
ldx $5678
|
|
|
|
beq @SPLIT2
|
2021-07-20 18:28:26 +00:00
|
|
|
nop
|
|
|
|
clc
|
|
|
|
xce
|
|
|
|
rep #$30
|
|
|
|
!al
|
|
|
|
!rl
|
|
|
|
pea STRING >> 16
|
|
|
|
pea STRING
|
|
|
|
jsl STRLEN
|
|
|
|
sec
|
|
|
|
xce
|
|
|
|
!as
|
|
|
|
!rs
|
|
|
|
jmp L00E6
|
|
|
|
|
|
|
|
STRING !text "testing"
|
|
|
|
!byte $00
|
|
|
|
|
|
|
|
!zone Z0000b2
|
|
|
|
.NH0 = $00 ;not hidden
|
|
|
|
.NH1 = $01 ;not hidden
|
|
|
|
.PTR0 = $10
|
|
|
|
.CONST0 = $10
|
|
|
|
.PTR_C = $1d
|
|
|
|
.PTR_D = $21
|
|
|
|
.VAL0 = $30
|
|
|
|
.VAL14 = $31
|
|
|
|
.VAL5 = $35
|
|
|
|
.SPLITTER = $80
|
|
|
|
.LEN = $f2
|
|
|
|
.PTR = $f4
|
|
|
|
.ARG = $fd
|
|
|
|
!al
|
|
|
|
!rl
|
|
|
|
STRLEN phd
|
|
|
|
tsc
|
|
|
|
sec
|
|
|
|
sbc #$00f7
|
|
|
|
tcd
|
|
|
|
adc #$00f0
|
|
|
|
tcs
|
|
|
|
stz .LEN
|
|
|
|
@L00C1 ldx .ARG+2
|
|
|
|
lda .ARG
|
|
|
|
inc .ARG
|
|
|
|
bne @L00CB
|
|
|
|
inc .ARG+2
|
|
|
|
@L00CB sta .PTR
|
|
|
|
stx .PTR+2
|
|
|
|
lda [.PTR]
|
|
|
|
and #$00ff
|
|
|
|
beq @L00DA
|
|
|
|
inc .LEN
|
|
|
|
bra @L00C1
|
|
|
|
|
|
|
|
@L00DA lda .LEN
|
|
|
|
tay
|
|
|
|
tdc
|
|
|
|
clc
|
|
|
|
adc #$00f7
|
|
|
|
tcs
|
|
|
|
tya
|
|
|
|
pld
|
|
|
|
rtl
|
|
|
|
|
|
|
|
!as
|
|
|
|
!rs
|
|
|
|
L00E6 bit .ARG+2
|
|
|
|
bit+2 $00ff
|
|
|
|
bit $0100
|
2019-09-01 03:32:43 +00:00
|
|
|
rts
|
|
|
|
|
|
|
|
} ;!pseudopc
|