Where to learn assembly

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
animangaman690
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 96
Joined: Mon Feb 02, 2009 8:03 am
Current Project: TDS
Favorite Gaming Platforms: PC
Programming Language of Choice: C/++, C#
Location: Alexander City, AL
Contact:

Where to learn assembly

Post by animangaman690 »

I'm wanting to learn assembly so I can decompile and edit a few programs of mine. I've looked for books but found none. So does any one know where on the web I could find some tutorials or if there is a book out there.
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Where to learn assembly

Post by Falco Girgis »

I've said this many times, and I'll say it again. I think you can't go wrong with college textbooks. Yes, they're extremely expensive, but you get a lot of bang for your buck. Part of learning assembly isn't just knowing opcodes, it's knowing what exactly the effect of these opcodes executing has on the hardware.

Find some sort of literature on x86 assembly. I must warn you, though. Wanting to learn assembly to screw with disassemblers (a decompiler produces C/++ code) is a pretty bad idea. All program structure is lost. It really isn't very human friendly.

Legitimate reasons to want to learn assembly would be something like wanting to write your own assembly programs/routines, or to learn more about architecture.
User avatar
Joeyotrevor
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 62
Joined: Thu Jan 22, 2009 6:24 pm
Programming Language of Choice: C++

Re: Where to learn assembly

Post by Joeyotrevor »

Code: Select all

eb 0c 48 65 6c 6c 6f 20 77 6f 72 6c 64 21 31 d2 8e c2 30 ff b3 0a bd 02 7c b9 0b 00 b8 00 13 cd 10 eb fe
User avatar
animangaman690
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 96
Joined: Mon Feb 02, 2009 8:03 am
Current Project: TDS
Favorite Gaming Platforms: PC
Programming Language of Choice: C/++, C#
Location: Alexander City, AL
Contact:

Re: Where to learn assembly

Post by animangaman690 »

I must warn you, though. Wanting to learn assembly to screw with disassemblers (a decompiler produces C/++ code) is a pretty bad idea. All program structure is lost. It really isn't very human friendly.
The main reason I want to learn assemble is because Direct X encrypts output variables saved to files in assembly.
Thanks.
andrew
Chaos Rift Regular
Chaos Rift Regular
Posts: 121
Joined: Mon Dec 08, 2008 2:12 pm

Re: Where to learn assembly

Post by andrew »

animangaman690 wrote:The main reason I want to learn assemble is because Direct X encrypts output variables saved to files in assembly.
DirectX comes with a tool to tell you what it's thinking as it is running. Not really sure if it's what you need. Here is a professional's experience with it.

This is a link to the MSDN documentation of it.
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Where to learn assembly

Post by Falco Girgis »

animangaman690 wrote:The main reason I want to learn assemble is because Direct X encrypts output variables saved to files in assembly.
It does what? Can I see a link or something to what you're talking about?
User avatar
animangaman690
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 96
Joined: Mon Feb 02, 2009 8:03 am
Current Project: TDS
Favorite Gaming Platforms: PC
Programming Language of Choice: C/++, C#
Location: Alexander City, AL
Contact:

Re: Where to learn assembly

Post by animangaman690 »

GyroVorbis wrote:
animangaman690 wrote:The main reason I want to learn assemble is because Direct X encrypts output variables saved to files in assembly.
It does what? Can I see a link or something to what you're talking about?
My bad, I was half asleep and tired as hell when I wrote this. What I mean is that Direct X uses an assembly program to encrypt and save files. At least that's what
my Game Programing with Direct X book said. The program was in the content on the CD. I tried to decompile it and remove the encryption process, but it
failed and said "Cannot decompile this program. Prebuilt in lower level language. Error Code: 330482." That is where the decompiler came into place. But your right,
trying to mess with a disassembler could screw up the program.

I tried to make an ofstream, but ofstreams and DX don't mix well for me due to some of the settings for a DX project.
I'm probably going to find some other ways of saving my variables for my map files.

I would still like to learn assembly though. So I'll probably see if my dad has any of his old college programing text books.
andrew
Chaos Rift Regular
Chaos Rift Regular
Posts: 121
Joined: Mon Dec 08, 2008 2:12 pm

Re: Where to learn assembly

Post by andrew »

It sounds like you might be trying to solve the wrong problem. Using an ofstream should be completely independent from DirectX.
What are you trying to do exactly?
User avatar
animangaman690
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 96
Joined: Mon Feb 02, 2009 8:03 am
Current Project: TDS
Favorite Gaming Platforms: PC
Programming Language of Choice: C/++, C#
Location: Alexander City, AL
Contact:

Re: Where to learn assembly

Post by animangaman690 »

Really, I'm trying to save my map files so that they can easily be read in something besides DX. That way I can move on to another API, because DX is very annoying to program in. It was a good start for game development back when it was first released, but now that it's tied in with Win32 it's a pain in the ass.
andrew
Chaos Rift Regular
Chaos Rift Regular
Posts: 121
Joined: Mon Dec 08, 2008 2:12 pm

Re: Where to learn assembly

Post by andrew »

You want to do something like this:

Code: Select all

bool Map::saveMap(char *filename)
{
    ofstream savefile(filename);
    if (!savefile.is_open())
    {
        cout << "Error opening map file!\n";
        return false;
    }

    savefile << map_w; // map width
    savefile << " ";
    savefile << map_h; // map height
    savefile << " ";
    savefile << n_layers; // number of layers
    savefile << endl;
    savefile << tile_w; // tile width
    savefile << " ";
    savefile << tile_h; // tile height
    savefile << endl;
    savefile << tilesetName; // tileset name
    savefile << endl;
    savefile << n_tiles;  // number of tiles
    savefile << endl;

    for (int layer = 0; layer < n_layers; ++layer)
    {
        for (int y = 0; y < map_h; ++y)
        {
            for (int x = 0; x < map_w; ++x)
            {
                savefile << mapdata[layer * (map_w * map_h) + (y * map_w) + x] << " ";
            }
            savefile << endl;
        }
        savefile << endl;
    }
    savefile.close();
    printf("Map saved\n");
    return true;
}
It's from a project I never finished. It saves the map as a text file.

I think this was the last version before I stopped working on it: zero051209.zip
Feel free to do whatever you want with it.
User avatar
animangaman690
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 96
Joined: Mon Feb 02, 2009 8:03 am
Current Project: TDS
Favorite Gaming Platforms: PC
Programming Language of Choice: C/++, C#
Location: Alexander City, AL
Contact:

Re: Where to learn assembly

Post by animangaman690 »

Thanks I will try something like that when I move on from DX
Post Reply