Jump to content
IGNORED

bne jmp bpl


Recommended Posts

Turns out I was wrong about my earlier post...as I could only find LDA-BPL/BMI combos in that other program.

 

 

But just as a test, I'd altered Adventure's routine...

;original

LDA Jstick ;Get joystick record.

AND #$C0 ;Merge out previous presses.

CMP #$40 ;Was it previously pressed?

BNE PickupPutdown_2 ;If not branch.

 

 

;works

BIT Jstick

BVS PickupPutdown_2

 

 

;fails

LDA Jstick

AND #$40

BVS PickupPutdown_2

 

 

;fails

LDA Jstick

AND #$40

CMP #$40

BVS PickupPutdown_2

Link to comment
Share on other sites

I wonder if there might be different behavior in different versions of the 6502 architecture? I know the 65C02 has additional instructions and addressing modes that the 6502 and 6507 don't. Perhaps later versions of the chip do update the V flag on a compare instruction...?

Link to comment
Share on other sites

Sorry, I was wrong about the Compare instructions. (I've modified my post.) I assumed that since CMP is so close to SBC that it would also affect the oVerflow flag (and didn't check my own refs :ponder: ). Wierd. I wonder why the designers decided to explicitly exclude it. Maybe there is a well known routine which needs that behaviour.

 

Sorry Erik, we were both wrong.

Link to comment
Share on other sites

I think the reason CMP's are excluded is because the purpose of V is to guarantee accuracy when doing extended calculations with signed numbers. Since CMP doesn't affect any values, V wasn't deemed necessary.

 

My point is it probably required extra transistors for CMx to not update V, and all indications are the 6502 design team didn't waste transistors without a good reason.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...