Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Rom Hacking: hukka | 2 guests
Acmlm's Board - I2 Archive - Rom Hacking - 65c816 asm question
  
User name:
Password:
Reply:
 

UserPost
MathOnNapkins
Posts: 162/2189
REP #31 tells us to set to zero three bits of the status register P:

#31: 0011 0001, therefore, the M,X, and C flags are reset by this instruction.

To know how I derived this you need to check your docs for the P register layout. I don't know all the positions off the top of my head, but M,X, and C come up so frequently I have the memorized since a long time ago.

The effect of this is to make the A, X, and Y registers 16-bits wide rather than 8, and the carry flag is reset because an add with carry operation will likely follow. Resetting the carry flag makes any subsequent ADC instruction a pure ADD, because the contents of the carry flag won't interfere with the result.

But this really has very little to do with how "bash" or whatever you call it works in the game. What it should tell you is that those functions work with 16 bit values though.
Sokarhacd
Posts: 114/1757
I was wondering something, as I look through Earthbound in the Snes ASM Dev Kit, I was in JHack and it tells you some ASM addresses of the attack stuff, example: bash uses C2859F in asm to tell it what to do I guess, what I was wondering is, how does REP #$31 tell bash to do anything? doesnt REP reset the processor flag, but there is one thing I dont understand, that is what exactly does the #$31 have to do with the REP command...as you can tell im in the process of learning ASM....

edit:Ive also noticed anything to do with actions such as bash, any psi, and what not has the asm REP #$31...so right now im kinda guessing that whats before the REP controls the action....
Acmlm's Board - I2 Archive - Rom Hacking - 65c816 asm question


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.004 seconds.