(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-02-24 04:10 PM
0 users currently in SMW Hacking.
Acmlm's Board - I3 Archive - SMW Hacking - So You Wanna Learn ASM [ASM howto]
  
User name:
Password:
Reply:
 
Options: - -
Quik-Attach:
Preview for more options

Max size 1.00 MB, types: png, gif, jpg, txt, zip, rar, tar, gz, 7z, ace, mp3, ogg, mid, ips, bz2, lzh, psd

UserPost
Sukasa
Posts: 2035/2068
Well, yeah. The thing is, I wanted to draw a direct line between the 24-bit text address and the hex.

besides, I always use 24-bit addresses anyways
Kailieann
Posts: 782/808
Originally posted by Pointlessly long name
8F 19 00 7E

85 19
Sukasa
Posts: 2033/2068
Hm, X816ii2F works fine for me

Okay... It's mostly pretty easy.

I'm going to show you how to do this in hex:

LDA #$02
STA $7E0019
RTS


Okay, so this is how you'd do the first one:

A9 02

Now, A9 is the hex version of LDA #$__ It can be LDA #$xx or LDA #$xxxx, depending on the processor bit width for the accumulator.

02 in that represents #$02. No biggie there.

then comes STA $7E0019. Pay close attention!
8F 19 00 7E

8F is, IIRC (I'm tired right now), STA $xxxxxx

19 00 7E is the address to store to. see how it's order is reversed? All numbers in 65c816 ASM are like that. Thus, 19 00 7E becomes 7E 00 19 when not reversed.

Lastly, RTS.

60

this is because 60 is RTS in hex, and there are no extra numbers to be had with this command.
C:/DOS/RUN
Posts: 26/31
Hey, can you teach us how to do this in hexadecimal? Because I understood the tutorial, but I can't find a compiler for windows that works.


Edit: I may have found a ASM compiler that works. It is called FASM.


Edit2: No, it does not work.
Sparx
Posts: 482/529
Oh, sure. You've made it so that I can, I just have to re-code them and stuff so they work. I had so many blocks I was going to make =)
Sukasa
Posts: 1673/2068
You're welcome

BTW, can you send me any blocks you make that you think would be good for inclusion in BTO? I'd appreciate it muchly.
Sparx
Posts: 481/529
Ok, I get it now. As would $01 go 2 after the $01 and so on. Thanks for the help with that, I was wondering why all of my custom blocks would just screw up
Sukasa
Posts: 1672/2068
break = branch for me

And yes, BEQ $00 would beak to the very next instruction, as you said.
Sparx
Posts: 480/529
So after BEQ with $00 next to it means the byte after $00? If that's the case, no wonder. I've been putting $0Y/ $0X (random numbers), thinking that it would branch to that offset number. And do you mean to put branch where break is?
Sukasa
Posts: 1661/2068
Take the next byte RIGHT AFTER the Break command's data byte. $00 means the very next operation, as if the break didn't exist. add or subtract byte as nessesary until you get to you target opcode's beginning in the hex file, and use that as your datra byte. Note that this nuber ius signed, and $80 to $FF is considered negative.
Sparx
Posts: 475/529
I was putting CMP #$(whatever) and right after, BEQs and/or BNE's. I guess I get it, but I guess I worded wrong, although your information helps a little.


It's the branching. Where does it branch to/ how do I get it to branch some where? Like the labels in a compiler... but how do I "branch to a label" in hex?
Kailieann
Posts: 354/808
Depends on what you're trying to do with it.
On its own, the CMP command doesn't do much. All it does is set some of the processor flags, which isn't going to produce noticable results on its own.

You can, however, use the newly set flags for branch statements.

For example, say your accumulator was 4, and you compared it to the number 3 using CMP #$03. This will set the Carry flag, which can then be used with BCC/BCS (Branch if Carry Clear/Set).

And, I do all my assembly by hand too.
Sparx
Posts: 473/529
Ok, I read the tutorial, and it's much easier to do it hex for me, as I couldn't get ANY compilers to work on my computer But anyways, I can make an average already made block easy, I can use most commands easily, but I can't figure how to get the CMP command right. Can somebody help?
Kailieann
Posts: 346/808
It was originally in the Advanced SMW Hacking forum. Which was eventually converted into an Advanced general rom hacking forum. Which was later merged with the regular rom hacking forum.
Sukasa
Posts: 1644/2068
I must have been moved there by accident, because it IS an SMW hacking thread. BBGen,txt mentioned there is still hosted by me too, I never took it down.
Goldensunboy
Posts: 152/287
Huh, why was that in ROM hacking? I guess that's why I didn't see it...

I'll try to do something with this once I get the chance, I have many higher-priority things to do now and this week. It seems like it could be interesting.
Kailieann
Posts: 343/808
Sprite-creating routine disassembly
Goldensunboy
Posts: 151/287
I was trying to do some things with sprite tool (I'm still at newbie at sprite hacking, bear with me), and I just can't figure out how to create another sprite.

Are there certain tables that should be written to? If so, which ones?

Also, is there a subroutine that does this automatically if I call it, and if so, what values should I store where? ($04-$09, or A/X/Y, or some table, perhaps)
Sukasa
Posts: 1608/2068
That woudl have been nice, but not knowing what they coudl have put in there, I am quite happy to use the 65c816 for all my needs.

But seriously, they should have used the SA-1 in place of the 65c816 (or 5A22, since that has all the features in use by the SNES 65c816...), because the instruction set was the same, but the clock speed was an ample 10Mhz.

That and the SA-1 is also apparently the reporting name for some russian Missile at NATO.
Glyphodon
Posts: 351/536
This is a good article.

I wish Nintendo put two processors inside the SNES, one top-of-the-line processor for new stuff and one 6502 for backwards compatibility. And then they could interupt each other and all kinds of dual-processing hilarity would ensue. That would have been so great.
This is a long thread. Click here to view it.
Acmlm's Board - I3 Archive - SMW Hacking - So You Wanna Learn ASM [ASM howto]


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.012 seconds; used 359.48 kB (max 427.34 kB)