Help learning assembly

Started by
13 comments, last by kamelbak 21 years, 6 months ago
Hey all. I''ve realized that there aren''t many printed books and many .pdf''s on assembly. With all of this stuff, which do you think would be best for an intermediate C++ programmer looking to learn assembly? Any advice on assemblers? A friend of mine recommended FASM. What tutorials and assemblers do you think an ASM newbie like me should start out with? Thanks! kamelbak
kamelbak
Advertisement
Hello,

Im assuming you want to learn assembly for x86''s
I suggest you use the inline assembler for Visual C++!!!!

int AddNumbers(int num1,int num2)
{
int result = 0;

_asm // <-- Tells compiler we are using assembly!!
{
mov eax,num1; // Store num1 in register ax
mov ebx,num2; // Store num2 in register bx
add eax,ebx; // Adds ax and bx, result is in ax.
mov result,eax; // Stores ax, in ''result''
}

return(result); // Returns the result!
}

Or something like that anyway - i feel this would be a nice easy way of getting used to assembly, and being able to mix it with C++ will make the transition easier for you.

here are some sites that you might find useful
http://www.azillionmonkeys.com/qed/asm.html#general
http://www.penguin.cz/~literakl/intel/intel.html

TRY THIS ONE FIRST - address was to long for the screen
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1258&lngWId=3
I began learning 16-bit ASM a month ago. 16-bit ASM programming is fun because you will recognized how high-level programming experience with OOP especially C/C++ help you design and implement applications in ASM. Without high-level experience ASM can be confusing.

Now I want to learn 32-bit ASM!

Kuphryn
Thanks you guys. I'll check out this places. Inline ASM sounds good. Say, what is the difference between 16 bit and 32 bit ASM? Any more compilers/tutorials? Thanks!

[edited by - kamelbak on October 3, 2002 9:28:32 PM]
kamelbak
I recommend you use MASM.

Here's an on-line book for learning 16-bit x86 ASM.

By the way, there are bunch of books on assembly language you can get. Try this.

Hope this helps!

Edit: One of links didn't work.

[edited by - Gladiator on October 3, 2002 9:34:47 PM]
Thanks. I think I''ll start 16 bit ASM, with either FASM or MASM. I was wondering though: I got a little bit into The Art of Assembly Language, but it seemed to be that it was mainly about some High Level Assembler. Is this to help you understand the basics of assembly or something? By the way, I think the Amazon link was the one that didn''t work.
kamelbak
Nevermind about the High Level Assembler thing. I''m thinking of a different one :D.
kamelbak
checkout masm & the Iczelion tutorials.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
If you have VC6 or VC7, they make a good for a good IDE and debugger when used with MASM.
1:difference with 16 and 32 bit assembly
32 - using api, eax, ebx, ect
try do something like winows routine you will see differece
2:
try TurboAssembler32, NASM makes smaller files (4k Tasm=3k Nasm), but its really makes no difference when using some code packers like upx
3:
books:
art of assembly, Iczelion tutorials, some CrackMe and Cracks sources and as always FAQ
4:
forget about VC and other non-only-asm compilers:
-you lose knownlege about win/linux routine
-you lose knownlege about executable files, sections etc., and without that whats for learning asembler? - if game works slowly use rather other algorithm than code it in asmebler
5:
some boot sector trick = on floppy you have 512-65(fat12 header)=447 bytes for your bootloader, so try do it in c++
6:
really asm is nowadays for virus writes (polymorphism, some code meshes engines etc.), but really there is nothing better to delete FAT on somebodys computer, or on tousands computers, or on milions computers...

This topic is closed to new replies.

Advertisement