Jump to content
Blue Azure

New 65C02 Instruction - OP CODE 80 - 7800 Only!

Recommended Posts

That's right fans, only on the 7800.

 

Have you ever noticed that all of the 6502 branch instructions end in a zero (0)? There were extras that BRK, CPX, CPY, JSR, LDY, RTI, and RTS used up. But one was missing. Until now. Finally exposed on atariage.com!!!

 

OPCODE $00 BRK Break - Force Interrupt, 1 byte, 7 cycles

OPCODE $10 BPL Branch if Positive, 2 bytes, 2 cycles

OPCODE $20 JSR Jump to Subroutine, 3 bytes, 6 cycles

OPCODE $30 BMI Branch if Minus, 2 bytes, 2 cycles

OPCODE $40 RTI Return from Interrupt, 1 byte, 6 cycles

OPCODE $50 BVC Branch if Overflow Clear, 2 bytes, 2 cycles

OPCODE $60 RTS Return from Subroutine, 1 byte, 6 cycles

OPCODE $70 BVS Branch if Overflow Set, 2 bytes, 2 cycles

 

OPCODE $90 BCC Branch if Carry Clear, 2 bytes, 2 cycles

OPCODE $A0 LDY Load Y Register immediate, 2 bytes, 2 cycles

OPCODE $B0 BCS Branch if Carry Set, 2 bytes, 2 cycles

OPCODE $C0 CPY Compare Y Register immediate, 2 bytes, 2 cycles

OPCODE $D0 BNE Branch if Not Equal, 2 bytes, 2 cycles

OPCODE $E0 CPX Compare X Register immediate, 2 bytes, 2 cycles

OPCODE $F0 BEQ Branch if Equal, 2 bytes, 2 cycles

 

HERE'S THE ONE THAT'S MISSING…

OPCODE $80 BBQ Branch if Ready to Party, 2 bytes, infinite cycles (!) This instruction runs until you stop it!

 

So what do you do with this new found instruction? Anyone who has programmed a game on the 7800 knows there's always a possible brick wall to your coding right around any corner. The former choices: (1) sleep on it and try again another day, (2) punt and cancel the game, or (3) call TEP392 and have Perry deal with it, as the 7800 insiders call it TEP-perware support, ya know Tepperware - every household should have Tepperware. Or now, we can use OP CODE 80.

 

How does OP CODE 80 work? If you have code, any code that you can't get to work, simply add OP CODE 80 and it will automatically solve the problem. You can have OP CODE 80 operate in a range, by entering $80$10 and it will diagnose and correct the 16 bytes following the BBQ (80) instruction. Or the master trick is to enter $80$00 and it will diagnose problems forever, or until you halt the process. This cutting edge technology is using the new 78XX Divide-By-Zero (DBZ) technology. Here's an example of some code with OP CODE 80 implemented:

 

MOVEDOIT:

D516---B5-A2-----LDA BALLXPOS,X ;FIRST CHECK IF THE BALL IS OUTSIDE THE BOUNDARIES OF THE SCREEN

D518---C9-18-----CMP #LEFTSIDE

D51A---90-FA-----BCC MOVEDOIT

D51C---C9-88-----CMP #RGHTSIDE ;RIGHT SIDE MINUS WIDTH OF SPRITE

D51E---B0-13-----BCS MOVEFORCEL

D520---B5-A6-----LDA BALLYPOS,X

D522---C9-C8-----CMP #BOTSIDE

D524---B0-14-----BCS MOVEFORCEV

D526---80-00-----BBQ EVERYTHING ;SOLVE ALL MY 7800 CODING PROBLEMS

D528---C9-04-----CMP #TOPSIDE + 4

D52A---90-10-----BCC MOVEFORCEV

D52C---B0-56-----BCS MOVEBALLOK

 

When this code was executed, it found that "90 FA" was wrong, and it should have been "90 10." Problem solved. Programming the 7800 has never been so easy!!!

 

How do you read these branch instructions anyways? Example "90 FA". When the number is less than zero, eg-FA you count backwards to find where the branch is jumping to. The first byte counted is FA which is count FF, the next byte backwards is 90=FE, and the next byte is 18=FD, and the next byte is C9=FC, and the next byte is A2=FB, and the final byte is B5=FA. This is where 90 FA will branch to in this code. For a positive count branch like B0 13, you count 19 (13 hex = 19 decimal) bytes beyond the B0 13. Hence you start counting at B5=01, A6=02, C9=03, etc.

 

 

Are you RDY2PARTY? Use BBQ OP CODE 80 today.

 

 

Could be Hollywood's next smash hit. OP CODE 80

  • Like 2

Share this post


Link to post
Share on other sites

Shhhhh. You can April Fools most people some of the time. For those who still believe in OP CODE 80,

this was a lot of work to hack the processor to squeeze out yet another instruction.

 

Welcome to 2nd quarter 2013. Still going strong on the 7800 developments. I have a new game coming soon.

Share this post


Link to post
Share on other sites

I found your bug blue.

 

D51A---90-FA-----BCC MOVEDOIT

 

should be BCC MOVEFORCER

 

Your welcome and consider this help free of charge. :) I'll require paypal for the next one. Now back to chasing bugs in DKXM.

Share this post


Link to post
Share on other sites

OK Stephen, BBQ not to be confused with BEQ. Glad I'm not the only one laughing here.

 

TEPmaster - Just checking you were still here and didn't fall asleep on Donkey for the XM.

Thanks for the help, but my code is now blue bug free with the help of OP CODE 80.

Share this post


Link to post
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.

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