Anyone know a good place to start?
I was interested in 'broadening my horizons' so to speak and assembly sounded interesting, more basic than C++ but also more 'powerful' i use that term loosely. I know you can combine C++ with some assembly too which sounded interesting.
So if anyone knows of a good book, online tutorial, etc (preferably book ;) ) let me know.
Oh and this computer here is an AMD Turion 64 CPU, cause i know that Assembly depends on the CPU, i assume this is in the same class as like the 8086 or Intel Family or whatever?
This is a good book on Assembly
For beginners the Book "THE INTEL MICROPROCESSORS" by Brey(80x86) is a very good book!
Well i could post some other links also but I suppose those are not permissible here.
PM me the links you can't post ;)
I got this one: Assembly Language for Intel-Based Computers (4th Edition) Its a text book and it looked really good, it shows you how to incorporate asm files into you're C/C++ projects as well. Anyone ever use this one?
Oh and any tuts in the meantime before i get the book to keep me busy would be great too =)
Nope. Back in the early 90's I essentially taught assembly language to myself, using the basic references available from Intel. Books are good and everything, but there really isn't that much TO assembly language. There is a small set of instructions that cover 99% of what you want to do. It's easy enough to learn how to use them in a few days.
Originally Posted by Junior89
The real challenge with assembly language is that it is so low-level, it feels like you have to write mounds of code in order to accomplish anything real. The challenge in learning assembly programming isn't in using the instructions, but understanding the the thousands of nuances of the architecture or platform you are working with.
I'm not trying to say I'm a super genius or anything. In fact, I still have half a bookshelf covered in books relating to low-level Intel architecture programming. It's just that none of those books is a general "How to program assembly language" book. I've got books on programming the PCI bus, books on programming DMA, IO ports and memory-mapped devices, books on utilizing the various protected mode features of the processor, etc. THAT stuff is the really cool part.
There are tutorials online. They pretty much universally suck, having been written either by demo-graphics-coders (who are highly skilled but far too specialized) or virus writers. To see real examples of working assembly code that does "real stuff," look at the various assembly language modules of the Linux kernel. They even have half-decent comments!
Also, get the gcc compiler if you don't already have it and use its "-S" switch. This causes the compiler to output assembly language instead of object code. There are other switches that cause the compiler to add comments to the code, so you can see how it relates to the C source. It's a good place to start experimenting with making tiny changes or adding your own stuff, without having to write the entire program yourself in assembly language.
Thanks for the input! I understand what you're saying, hopefully this book is a decent introduction. I'll download the manuals from Intel i suppose =)
I learned Assembly a while back from a few tutorials that where quite basic err, I donno if I still have them handy I'll look them out, but if you want to see some impressive code I suggest the NeHe site, all the tutorials are designed to teach C++ with OpenGL, but at the bottom of ever tutorial are the links to download the source, and some of the tutorials actually have an assembly version of the code in the tutorials, I can't say off hand which ones, but I looked at one and I must say I was impressed . . .
I think is the link I learned from, sorry I aint sure of the codes the forum uses yet
two other links I found when i was learning I didn't look into them in great detail but I hope they have something to help you in your search for greater knowledge
Well thank you for your help =)
I'll take a look ;)
The thing that helped me with assembly when I would get stuck with writing things was to think about what I was trying to accomplish at a more higher level. Just like how people are recommended to think in pseudo-code when having trouble in C, I would tend to think in C when having trouble with assembly.
brewbuck is totally right about feeling that you have to write loads of code to do something simple, but on the other hand, the shortcuts and super fast code that you are able to write make it worth while. In addition, due to learning assembly, I became aware of bad coding practices that I was using when programming in C that made for very inefficient assembly. Modern compilers probably are able to catch some of these bad practices, but it's not always guarenteed that they will save you.
Try not to get caught up in lots of assembler-specific macros or anything like that. I know assembly isn't portable, but learning compiler-specific things in C don't always help you in the long run if you're dependent upon them.
ah... very interesting, thanks! =)
I suppose I should have mentioned that I actually have that book, or rather I have the 5th edition of it.
My main complaint would be that the author's examples were written with a custom set of macros that seemed to really hide what was going on. I know they can be quite useful, but I would have preferred that most examples use either the C library or Win32 API functions. Since you already know how to use them in C/C++ (hopefully :p ), to see how they are used in assembly would seem to me the best way to help someone learn the language, but I digress.
Overall, the book does cover many items, so between it and any other references to fill in the blanks, you should get a good idea of what assembly is about.
Yep, I've got that book too, although I've only ever really used it as an instruction reference and a quick insight into particular instructions.
One way of developing your assembly language skills is by studying the disassembly of programs. Yes it's a bit of a dark art, but certainly with simple DOS programs you can learn a lot about what does what by following the flow of execution in your head.
Then you can apply all that to writing stuff! ;)
Reverse engineering? ha sounds interesting as well =)
It can be fun when you're learning. Once you're experienced, it's just boring busy work. I'd rather write new code from scratch :-)
Originally Posted by Junior89
My first experience with reverse engineering was when I was a kid playing Might & Magic III. You could save and restore your game, and the game data got written to a big binary file.
I spent several MONTHS of after-school time trying to understand the data format of those save game files. Eventually I built up a book of several hundred pages, consisting of tables of offsets, magic values, flags, etc. I could modify my characters in any way I wanted, change the inventory, warp myself to different places in the game, etc.
It was actually one of the inspirations for me to begin "real" programming (I'd done some little stuff before but nothing real). I wanted to write a Windows application for editing MMIII savegame files and sell it as shareware. Never finished that project, but it launched me in a direction that has influenced my entire life.