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 | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
Sokarhacd

Ball and Chain Trooper
Resistance is Futile
You Will Be Assimilated
Hab SoSlI' Quch
Level: 61

Posts: 114/1757
EXP: 1799888
For next: 76708

Since: 03-15-04

Since last post: 6 days
Last activity: 4 hours
Posted on 04-30-04 08:55 AM Link | Quote
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....


(edited by Chaosflare on 04-29-04 11:59 PM)
MathOnNapkins

Math n' Hacks
Level: 67

Posts: 162/2189
EXP: 2495887
For next: 96985

Since: 03-18-04
From: Base Tourian

Since last post: 1 hour
Last activity: 32 min.
Posted on 04-30-04 09:47 AM Link | Quote
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.


(edited by MathOnNapkins on 04-30-04 12:54 AM)
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
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.011 seconds.