Just Jeff Posted October 7, 2016 Author Share Posted October 7, 2016 Normally ZP means Zero Page when talking about 6502 assembler. That makes sense. Thanks! Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted October 7, 2016 Author Share Posted October 7, 2016 (edited) Here's something I've never seen before. The last bcc and bcs don't point to instructions, only to blank play field data. What does that do? LF0F1 sta VSYNC,x ; 4 inx ; 2 bne LF0F1 ; 2 ;jmp LF7A2 ; 3 directly jump to PCM code jmp LF637 ; 3 Go to playfield routines beq LF0CB ; 2 bvs LF0CD ; 2 bne LF10F ; 2 cpx #$10 ; 2 bne LF083 ; 2 cpx #$B0 ; 2 bcs LF127 ; 2 ldy #$A0 ; 2 bcs LF0BB ; 2 bcc LF0AD ; 3 Here's what those last two point to: .byte $00 ; | | $F0AB .byte $00 ; | | $F0AC LF0AD: .byte $00 ; | | $F0AD .byte $00 ; | | $F0AE .byte $00 ; | | $F0AF .byte $00 ; | | $F0B0 .byte $00 ; | | $F0B1 .byte $00 ; | | $F0B2 .byte $00 ; | | $F0B3 .byte $00 ; | | $F0B4 .byte $00 ; | | $F0B5 .byte $00 ; | | $F0B6 .byte $00 ; | | $F0B7 .byte $00 ; | | $F0B8 .byte $00 ; | | $F0B9 .byte $00 ; | | $F0BA LF0BB: .byte $00 ; | | $F0BB .byte $00 ; | | $F0BC Edited October 7, 2016 by BNE Jeff Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted October 7, 2016 Share Posted October 7, 2016 $00 is the BRK instruction. What does the interrupt vector point to? Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted October 7, 2016 Author Share Posted October 7, 2016 Well I don't know.. I thought Atari did not use them, so I don't even know how to identify an interrupt vector. Is it on a table? Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted October 7, 2016 Share Posted October 7, 2016 It looks like unused code to me.There is no label after the JMP instruction. So unless there is an indirect jump like JMP() or BRK (which doesn't exist in this code), which DiStella cannot detect, this code is never executed. Also all labels of this code are irrelevant. The break vector points to the normal start address. Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted October 7, 2016 Share Posted October 7, 2016 The IRQ/BRK vector is at address $FFFE. Does that point to any code? 1 Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted October 8, 2016 Author Share Posted October 8, 2016 fffe just contains another .byte ($EA).. Something else new.. What does LF127 = . - 1 mean? LF123 ldy #$00 ; 2 lda LF1B2,y ; 4 LF127 = . - 1 sta $98 ; 3 iny ; 2 sty $99 ; 3 Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted October 8, 2016 Share Posted October 8, 2016 $FFFE is a vector, so you must read $FFFF too. Together they point to the start address of the ROM. . = current address, so: . - 1 = current address -1 You can't put a label directly there, because the address is in the middle of the previous instruction. Since this label is addressed from the unused code above only, it makes no sense here. Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted October 8, 2016 Author Share Posted October 8, 2016 Ah.. Didn't know what a vector was. So a vector is kind of like a register for the 6502- right? This has definitely been a worthwhile exercise so far- Learning so much stuff here: How to use DiStella you can ROL RAM, not just the accumulator DiStella can't identify all tables Little Endian, for like the fourth time Mirroring More DiStella characteristics Local labels and variables ZP Break, vector .-1 and more that doesn't come to mind just now So I did a substantial amount of labeling and got through the graphic stuff well enough, but then when I arrived at the speech? sound routine, it was tough to understand. I also looked through the labeling that you put on the music, and couldn't identify any missing labels. I felt it might be time to focus only on the music. So I chopped out the graphic routines, and the speech, and kept just the music. It compiled without error, but plays garbage. Does anybody feel like taking a look and maybe pointing me in the right direction? I know that the break vector is not correct, but when I changed it, to 00, f0 I think, nothing changed so I changed it back. Not sure if I'm even using it. Thanks once again! xx.asm Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted October 8, 2016 Share Posted October 8, 2016 You messed up the vectors at the very end. Else everything is fine. xx.asm Quote Link to comment Share on other sites More sharing options...
Just Jeff Posted October 8, 2016 Author Share Posted October 8, 2016 OK Thanks.. Seems strange that we can't just ORG $fffe then .word start Right now I'm trying to cut it down to a 2K file. I: changed the first ORG to $f800 removed ORG $f967 It half worked. Played the first song, not the second. If I leave ORG $f967 I get a compile error- reverse indexed. I thought it might be a page boundary thing but an align 256 didn't help At this point I'm wondering why it would need to be in there. Somewhere a pointer is off by $800 I suppose? Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted October 8, 2016 Share Posted October 8, 2016 Please check the docs, $FFFC is the start vector, $FFFE the break vector Quote Link to comment Share on other sites More sharing options...
Papa Posted October 8, 2016 Share Posted October 8, 2016 (edited) I have stopped analyzing, now that I know how it works. I can give you my file, it assembles and works, but it has some little modifications too. HOLY CRAP! REMOVE THE DOT! HA HA HA HA HAAAAAAA! xsqueeker_org.asm I know you all iz nerdz, but 'dis is reel!! Edited October 8, 2016 by Papa Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.