Sunday, January 27, 2013

An Assembly Intro

This is part 1 of probably very many of a sort of course where I lay out basically everything I know about assembly. We'll start from the beginning at what instructions are and what they do and we'll end up very, very deep into some of the most complex stuff you can accomplish.  That said, let's get started.  We have a lot to do!


Tools
These are all the main tools I use when I'm working on stuff.

IDA
There's one main tool to use: IDA 6.1.  IDA is amazing in pretty much every way and you'll use it constantly.  It can work with ARMv4 and ARMv5 no problem, among many, many other architecture types.  It's very easy to use for debugging or plain disassembly, great for organization, can handle most of what you'll need for keeping notes, types, functions, almost anything you need.  Get this asap.

No$GBA
No$GBA debugger is a very valuable tool for working with GBA games.  There's no version of VBA that can connect properly with IDA, so you'll likely be using a mix of No$GBA(a.k.a. "Nocash") with a symbol file to do the debugging and IDA for keeping your notes, labels, symbols, etc.  This is a very good tool even though it hasn't been updated since 2008.  

Desmume
The best DS emulator.  Desmume can be compiled so that it can interact with GDB and thus, IDA.  So for NDS debugging, you would use IDA with a database connected to Desmume.  It's nice that you can use its RAM watch, cheat system, and other tools while linked with IDA.  Being able to very quickly(and temporarily) change a bit of code with an Action Replay cheat is very handy.  The cheat system is also great for adding/testing full ASM hacks that you build elsewhere.  Use the latest version that you possibly can.  As of this writing, the GDB version in use is .9.9 dev+ x86. 

ASMtoARDS
This is a tool to build AR codes from plain assembly.  You can use ARM or THUMB  and it builds with a version of GAS(GNU Assembler) so you can use any macros or abilities that assembler has.  This is a very handy tool.  

Kodinator
This thing has 3 tabs, but the only useful one is the middle tab.  The branch builder is rather handy.  It can make 2 different kinds of branches depending on whether you're using ARM or THUMB.  This is something we'll come back to later.

DevkitARM
DevkitARM is part of a set of toolchains maintained by Wintermute.  They include DevkitARM, DevkitPPC, and DevkitPSP.  The ARM devkit is for building for the GBA and DS(and other ARM architectures- it's not just for making programs for the DS and GBA), the PPC kit is for the GameCube and Wii, and the PSP kit is obviously for the PSP.  Installing DevkitARM is useful for many, many reasons.  You can code things up and copy and paste them right into your ASM hacks, code up tests to see what the ASM looks like for given code, figure out how the systems work to a greater extent, and so forth.  You absolutely should install this.  If you're on Windows, just go get the installer.  It's really easy.

Tinke
This isn't specifically for assembly, but it's an amazing, amazing DS filesystem viewer.  It can open many kinds of files and can browse and replace files in sdats and is just extremely, extremely useful all-around.  

CrystalTile 2
An indispensable program.  It can extract and decompress many file types, can view the full filesystem for a ROM, and most importantly, it's the only tool that can show you the exact memory locations that overlays will be loaded to.  You can do that yourself using a table in a file in the filesystem, but it's so much easier this way.  This is extremely handy and we will be making good use of it later.

No comments:

Post a Comment