Jump to content



1

bne jmp bpl


34 replies to this topic

#26 Bryan OFFLINE  

Bryan

    Quadrunner

  • 7,626 posts
  • Cruise Elroy = 4DB7
  • Location:Port St. Lucie, Florida

Posted Tue Apr 20, 2004 5:25 AM

But the links that have been posted are already correct: :? :?

Attached Thumbnails

  • opcode.jpg


#27 Cybergoth OFFLINE  

Cybergoth

    Quadrunner

  • 8,207 posts
  • This is Sparta!
  • Location:Bavaria

Posted Tue Apr 20, 2004 6:07 AM

Hi there!

bryede said:

But the links that have been posted are already correct:  :?  :?

That's what I meant when I was repeating Eriks quote :)

Greetings,
Manuel

#28 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!

  • 16,745 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Tue Apr 20, 2004 6:12 AM

Hm, I suppose I shouldn't post while being on a Java training. ;)

#29 Nukey Shay OFFLINE  

Nukey Shay

    Sheik Yerbouti

  • 20,458 posts
  • Location:The land of Gorch

Posted Tue Apr 20, 2004 6:23 AM

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

#30 ErikM OFFLINE  

ErikM

    Space Invader

  • 21 posts
  • Location:New York

Posted Tue Apr 20, 2004 8:52 AM

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...?

#31 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!

  • 16,745 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Tue Apr 20, 2004 9:09 AM

ErikM said:

Perhaps later versions of the chip do update the V flag on a compare instruction...?
I don't know, but I suppose not, else that would have broken backward compatibility for legal (or documented) opcodes.

#32 EricBall OFFLINE  

EricBall

    Dragonstomper

  • 711 posts
  • Location:Markham, Ontario, Canada

Posted Tue Apr 20, 2004 7:17 PM

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.

#33 Bryan OFFLINE  

Bryan

    Quadrunner

  • 7,626 posts
  • Cruise Elroy = 4DB7
  • Location:Port St. Lucie, Florida

Posted Tue Apr 20, 2004 7:34 PM

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.

-Bry

#34 EricBall OFFLINE  

EricBall

    Dragonstomper

  • 711 posts
  • Location:Markham, Ontario, Canada

Posted Wed Apr 21, 2004 8:44 PM

bryede said:

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.

#35 Bryan OFFLINE  

Bryan

    Quadrunner

  • 7,626 posts
  • Cruise Elroy = 4DB7
  • Location:Port St. Lucie, Florida

Posted Wed Apr 21, 2004 8:50 PM

It's probably part of the same logic that suppresses the result from being written to A.

-Bry




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users