6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu May 09, 2024 7:23 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Sep 16, 2022 2:17 am 
Offline

Joined: Fri Nov 16, 2018 8:55 pm
Posts: 71
So, I've encountered a strange issue with 64tass. When I use labels with jmp and jsr these opcodes don't get pointed to the memory location I expect. Passing labels to branch instructions, example bcc, works just fine. I've checked and I don't see any obvious cases of double-defining a label or any simple mistake like that. I also double-checked the documentation and in the .ptext section I can see a jsr being used with a label.

For clarity sake, here is a random slice of code:

Code:
L_8284                  lda $19                      ; $8284    $a519   ;
                        sta $1d                      ; $8286    $851d   ;
                        dec $15                      ; $8288    $c615   ;
                        beq L_828f                   ; $828a    $f003   ;
                        jmp L_8200                   ; $828c    $4c0082 ;
L_828f                  ldy #$17                     ; $828f    $a017   ;
                        ldx #$17                     ; $8291    $a217   ;
L_8293                  lda $9fb0,x                  ; $8293    $bdb09f ;


The column on the left contains labels followed by opcodes and operands. The columns on the right enclosed in comments contain the current memory offset followed by the raw bytes of the opcode and operand for that line. Branching to L_828f works just fine. But, passing L_8200 to the jmp instruction produces unexpected output when I assemble the file. I'm disassembling and reassembling a cartridge. I've just about got it working except for this. What am I missing?

I'm running 64tass v1.56 r2625 on Linux; I built the 64tass binary myself as it's not in my OS's software repo.


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 16, 2022 3:56 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8432
Location: Southern California
I'm not familiar with 64tass; but it looks like your labels are merely the address tacked onto the end of "L_". Remember that JMP's operand goes low byte first; so JMP $8200 will come out 4C 00 82.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 16, 2022 5:13 pm 
Offline

Joined: Fri Nov 16, 2018 8:55 pm
Posts: 71
I got it to work. I missed two important things.

My *= variable was not quite correct and I was missing a flag with 64tass. It's working now.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: