![]() |
never heard of assembly..
|
It's a programming language which is as close to machine code as you can get. It has mnemonic commands that tell the computer what to do. It is different from other higher level languages in that when you see something like
:
printf("hello world");It sends many instructions to the computer. In assembly, you see something like: :
add 1, axWhich will translate directly into one instruction to the machine. |
Assembly is the lowest level of all programming languages. Assembly instruction are the actual instructions the processor receives.
Each assembly command (that is operative) actually equates to a very specific machine code instruction, while in languages like C++ each C++ instruction equates to several machine code instructions. Many language compilers, including most C++ and C compilers compile first to ASM code and than assemble the ASM code to machine code. (You can even use a command line switch to output the ASM code to a file). |
I have a question myself. Could someone clear up the pros and cons of Assembly to other languages in a fairly brief statement. I know that higher level languages are easier to type and read, but what other beinfits are there of each. Isn't assembly suposed to be faster?
|
Well, Ok.
Pros: Learning assembly language will increase your knowledge of the computer tenfold. You are in complete control of your machine. Assembly code is as fast as it gets. You can get access to unusual programming modes of your processor. You can use it with some high-level languages Cons: Very tedious to write. It is quite often buggy. These bugs are hard to find. not portable There are probably a lot. Either way, I think it's good knowledge, whether you use it or not. Plus, just about any "hacker" book you read will tell you to learn assembly. :ph34r: |
Actually the debate as to whether or not assembly code executes faster is really not clear. There was a time, when the 386 and 486 rules the market that pure ASm written code (if written by a seasoned developer) would be the fastest code for its functions that you can get, and even now for very specific operations (in which optimizers are KNOWN to not be able to optimize very well) that also holds true.
However with the advent of multi-stage instruction execution in the processor, the IP look-ahead (which actually tends to change code before it hits the processor now to further optimise it) writing an entire application in ASM may not have any benefit over using a properly optimized higher level language. |
I stand corrected.
|
Write it in C, then break to Assembly and remove bloat and bugs. "gcc -S pr0n_finder.c"
|
Thanks, well that clears some up for me at least :)
|
very infomative info in this thread indeed.
|
| All times are GMT -5. The time now is 1:00 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC