+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  So who do I have to kill to learn 6502 ASM?
Pages: [1] 2
Author Topic: So who do I have to kill to learn 6502 ASM?  (Read 1497 times)
Kitsune Sniper
Guest
« on: December 28, 2006, 12:07:06 am »

Yeah. Took me six years but I finally want to learn. There's tons of stuff I want to do. And begging others to do them for me won't work. So. Uh. Where do I start?

And don't use the newbie RTFM thing on me. Tongue
Lenophis
Guest
« Reply #1 on: December 28, 2006, 12:17:16 am »

For me, I managed to learn by actually diving into the assembly and hacking it up as I go. Strange that I picked 65816, but the two are more or less the same. But, having checked the documents here, I'd say you have some options. If you know 65816 then you are halfway there already. Oh yes, and don't forget FCEUXDSP1. Smiley
Kitsune Sniper
Guest
« Reply #2 on: December 28, 2006, 12:24:35 am »

I know nothing about ASM.

I've hobbled for six years on basic beginner romhacks. :p

I'll look into those in a bit.
RedComet
Guest
« Reply #3 on: December 28, 2006, 12:36:17 am »

No offense Lenophis, but the first link is probably the only one that would be useful to a newbie. The other two are more or less reference material.

My advice would be to pick up Programming the 6502 by Rodnay Zaks. I tried to learn for a couple years from what is available online, but I never managed to get it. I picked up Zaks' book and it helped a *lot*. The first two chapters go over the key concepts of low level programming and there's questions scattered throughout the chapters to make sure you actually understand the material being presented. The third chapter goes over the instruction set, but you can easily use a reference doc for that. The last couple of chapters go over practical applications, but I never read those.

After you understand the basics of asm, then you have to contend with the actual hardware, for which I'd recommend Yoshi's NES Tech. Read that through, crack open a game and then start tinkering with it. With any luck you'll understand what's going on. Smiley

You should probably expect to spend at least a month or two learning everything, depending on how fast you learn and how well you comprehend the material, before you can actually do something with it.
Lenophis
Guest
« Reply #4 on: December 28, 2006, 01:00:30 am »

Quote from: RedComet on December 28, 2006, 12:36:17 am
No offense Lenophis, but the first link is probably the only one that would be useful to a newbie.
None taken, I didn't search very long. I basically grabbed the first couple I saw, which is to say that I didn't do a good job.

Kitsune: one way or another you'll want a copy of the instructions.

Quote from: Kitsune Sniper on December 28, 2006, 12:24:35 am
I know nothing about ASM.
How much did you know about rom hacking before you actually started doing it? You'll pick up on it soon enough, just have patience. Smiley
Jedi QuestMaster
Guest
« Reply #5 on: December 28, 2006, 01:55:10 am »

I, too wanted to learn.  I was told it'd be a good idea to learn Assembly first.
Ryusui
Guest
« Reply #6 on: December 28, 2006, 03:35:36 am »

I bought a book on ASM once. Don't remember how much of it I found useful, but the best teacher is experience. Open up an emu with a tracer and watch what it does. Like understanding a clock by examining the gears. The best part here is that you can watch every tick without worrying about how to fit the damn thing back together. ^_^

Every processor aims to do the exact same thing; the specifics vary, but once you understand the basic principles - registers, the stack, loading, storing, shifting, the boolean collection, et cetera - you can adapt your knowledge to any processor. It's just a matter of finding the right tools.

Even before I trusted myself enough to crack compression's kneecaps, I triumphed over G Gundam's title screen and made the game load my own uncompressed title from the ROM. It's not that difficult to get started: most of the hard work has already been done by the guys in Japan whose work you're vandalizing for the greater good. ^_^
creaothceann
Guest
« Reply #7 on: December 28, 2006, 04:59:04 am »

http://atarihq.com/danb/6502.shtml
http://6502.org/
http://www.atariarchives.org/mlb/
http://www.npsnet.com/danf/cbm/cross-development.html
http://en.wikibooks.org/wiki/6502_Assembly
http://ericclever.com/6500/
http://www.wiz-worx.com/resume/byte8010.htm

You'll also need technical information about the system... check out e.g. nesdev.parodius.com.
Kitsune Sniper
Guest
« Reply #8 on: December 28, 2006, 05:23:15 am »

I just ordered that book you recommended, RedComet. It cost me five bucks from Amazon (shipped). I should get it in a week or so.

The thing is, I -know- that book was at my college library. I saw it. But it was in Spanish so everything was mixed up. At least now I'll have a copy I can understand.
RedComet
Guest
« Reply #9 on: December 28, 2006, 06:20:02 am »

Feel free to poke me if you have any questions. Smiley

Also, you might want to give this a look once you get going. It's aimed at beginners, but since I haven't actually gotten any feedback, I don't really know how effective it is. So, this could prove useful for the both of us. ^_^
tomaitheous
Guest
« Reply #10 on: December 28, 2006, 11:12:52 am »


 I think the biggest help in learning any version of ASM is having a good debugger. You really need to see what you code is doing  - see it in action to get a feel for it. That's why I recommend writing for GB as a first step. It's one of the easiest systems to learn on. While Z80 isn't 6502, they come from the same era and share a lot of fundamentals.

 Don't forget, you're learning ASM and the inner workings of the proprietary system you're writing for. That's two different things right there. My best recommendation is to write some demos as your first ASM goal. That way you'll get you more familiar with the hardware and the experience transfers over to hacking nicely.

-Rich
Ryusui
Guest
« Reply #11 on: December 28, 2006, 01:30:48 pm »

It's not really Z80, as TASM's supplied Z80 table will not compile 100% GB-compatible code (the instructions for loading from memory at FF80 are GB-specific; you'll need a special table for them). But it's close enough.

Part of what makes GB programming a good place to start is that it gives you a bunch of registers to work with: instead of the A, X and Y of the 6502/65816 line, it gives you the classic 8-bit accumulator (A), plus three sets of register pairs: BC, DE and HL. (They can be treated as individual 8-bit registers, or three 16-bit ones.) To stretch the clock metaphor, this is like one of those high-end fancy clocks with cutouts for viewing the internal workings.
tomaitheous
Guest
« Reply #12 on: December 28, 2006, 02:13:40 pm »


 Here's a recompiled version of NESASM. Some of the older versions had problems with XP's DOSX dpmi.

 And a doc to start writing NES demos in asm (NESASM). Check out nesdev.parodius.com for more.

Spikeman
Guest
« Reply #13 on: December 29, 2006, 12:31:36 am »

Quote from: Ryusui on December 28, 2006, 01:30:48 pm
Part of what makes GB programming a good place to start is that it gives you a bunch of registers to work with: instead of the A, X and Y of the 6502/65816 line, it gives you the classic 8-bit accumulator (A), plus three sets of register pairs: BC, DE and HL. (They can be treated as individual 8-bit registers, or three 16-bit ones.) To stretch the clock metaphor, this is like one of those high-end fancy clocks with cutouts for viewing the internal workings.

I agree with z80 being nice, but try doing some GBA programming. You get 10 registers in THUMB mode and 16 registers in ARM mode (if you count the link register and the program counter).
Jigglysaint
Guest
« Reply #14 on: December 29, 2006, 06:45:02 pm »

After many years of not really knowing anything about ASM except how to recognize certain opcodes, I managed to understand, and about to finish(maybe) my first full featured rom hack.  I think the problem is that most of the stuff you find assumes that you are approaching ASM from a programmer's viewpoint and not a causual rom hacker.  Things like the relationship between ASM code and RAM, rom banks, and what each opcode does is not always given from the point of view that the rom hacker knows little about how computers work.

It was only after trial and error, asking questions, and lots of time that I managed to create new code that altered the game substantially.  I should compile what I've learned and hopefully it will help in explaining ASM to people like me who arn't programing savy.
Pages: [1] 2  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC