Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Assembly (http://www.programmingforums.org/forum20.html)
-   -   What Is Assembly (http://www.programmingforums.org/showthread.php?t=431)

sphyenx Aug 28th, 2004 10:33 AM

never heard of assembly..

Mjordan2nd Aug 28th, 2004 11:33 AM

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, ax

Which will translate directly into one instruction to the machine.

kurifu Aug 28th, 2004 6:52 PM

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).

thechristelegacy Aug 29th, 2004 12:15 PM

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?

Mjordan2nd Aug 29th, 2004 1:09 PM

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:

kurifu Aug 29th, 2004 10:46 PM

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.

Mjordan2nd Aug 29th, 2004 11:20 PM

I stand corrected.

Kylixen Aug 30th, 2004 11:12 AM

Write it in C, then break to Assembly and remove bloat and bugs. "gcc -S pr0n_finder.c"

thechristelegacy Aug 31st, 2004 6:52 PM

Thanks, well that clears some up for me at least :)

Pizentios Sep 1st, 2004 8:46 AM

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