ould someone please explain how the BIT op is working in these two
routines? I've verified the branch and jump instructions lead to valid
routines. This is from Kwik Copy, extracted form a freeze file. I have
100% of the routines seperated from it's text. Is it that the program is
entering these routines from multiple angles?
17df:17df:1 8a txa
17e0:17e0:1 18 clc
17e1:17e1:1 69 01 adc #$01
17e3:17e3:1 d0 ea bne $17cf
17e5:17e5:1 24 1f bit $1f
17e7:17e7:1 19 12 0c ora $0c12,y
17ea:17ea:1 0c ???
17eb:17eb:1 0d 0e a6 ora $a60e
17ee:17ee:1 40 rti
17ef:17ef:1 48 pha
17f0:17f0:1 4a lsr a
17f1:17f1:1 4a lsr a
17f2:17f2:1 4a lsr a
17f3:17f3:1 85 29 sta $29
17f5:17f5:1 8a txa
17f6:17f6:1 0a asl a
17f7:17f7:1 0a asl a
17f8:17f8:1 05 29 ora $29
17fa:17fa:1 a8 tay
17fb:17fb:1 68 pla
17fc:17fc:1 29 07 and #$07
17fe:17fe:1 aa tax
17ff:17ff:1 b9 01 2d lda $2d01,y
1802:1802:1 3d 06 18 and $1806,x
1805:1805:1 60 rts
1806:1806:1 01 02 ora ($02,x)
1808:1808:1 04 ???
1809:1809:1 08 php
180a:180a:1 10 20 bpl $182c
180c:180c:1 40 rti
180d:180d:1 80 ???
180e:180e:1 a9 12 lda #$12
1810:1810:1 85 40 sta $40
1812:1812:1 a9 00 lda #$00
1814:1814:1 85 41 sta $41
1816:1816:1 4c 7b 23 jmp $237b
This is the same routines auto labled, where you can see seperate
routines entering at different points (not all of the labels are valid I
suspect).
17df:17df:1 8a skip17df txa
17e0:17e0:1 18 clc
17e1:17e1:1 69 01 adc #$01
17e3:17e3:1 d0 ???
17e4:17e4:1 ea lbl_17e4 nop
17e5:17e5:1 24 1f bit zp_1f
17e7:17e7:1 19 ???
17e8:17e8:1 12 ???
17e9:17e9:1 0c lbl_17e9 ???
17ea:17ea:1 0c ???
17eb:17eb:1 0d ???
17ec:17ec:1 0e ???
17ed:17ed:1 a6 40 sub_17ed ldx zp_40
17ef:17ef:1 48 sub_17ef pha
17f0:17f0:1 4a lsr a
17f1:17f1:1 4a lsr a
17f2:17f2:1 4a lsr a
17f3:17f3:1 85 29 sta zp_29
17f5:17f5:1 8a txa
17f6:17f6:1 0a asl a
17f7:17f7:1 0a asl a
17f8:17f8:1 05 29 ora zp_29
17fa:17fa:1 a8 tay
17fb:17fb:1 68 pla
17fc:17fc:1 29 07 and #$07
17fe:17fe:1 aa tax
17ff:17ff:1 b9 ???
1800:1800:1 01 2d lbl_1800 ora (zp_2d,x)
1802:1802:1 3d 06 18 and lbl_1806,x
1805:1805:1 60 rts
1806:1806:1 01 02 lbl_1806 ora (zp_02,x)
1808:1808:1 04 ???
1809:1809:1 08 php
180a:180a:1 10 20 bpl skip182c
180c:180c:1 40 rti
180d:180d:1 80 ???
180e:180e:1 a9 12 sub_180e lda #$12
1810:1810:1 85 40 sta zp_40
1812:1812:1 a9 00 lda #$00
1814:1814:1 85 41 sta zp_41
1816:1816:1 4c 7b 23 jmp sub_237b