assembly language programming

assembly language programming

Alok Alan's picture

i'am new to computer programming in general and assembly language programming in particular.please guide me on how to begin programming in assembly language.

thanks

9 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
mt2's picture
Quoting - Alok Alan i'am new to computer programming in general and assembly language programming in particular.please guide me on how to begin programming in assembly language.

thanks

Please, see:

http://en.wikipedia.org/wiki/Assembly_language
http://en.wikipedia.org/wiki/Assembly_language#Further_reading
http://en.wikipedia.org/wiki/Assembly_language#External_links

hrfmac's picture
It is very frustrating going to the intel site and being referred to wiki as a source. Being wiki is not an authoratative source it is very discouraging to see technical advice pointint to it. I too would like to know about assembler for Intel chips. Wiki is ok, but it should never be used as a true reference due to the open source nature of the document.

So, I will ask the same question. Where here on Intel can I learn about INTEL's assembler language.

Quoting - mt2
Please, see:

http://en.wikipedia.org/wiki/Assembly_language
http://en.wikipedia.org/wiki/Assembly_language#Further_reading
http://en.wikipedia.org/wiki/Assembly_language#External_links

What I found after this post here on Intel is
http://software.intel.com/en-us/articles/intel-c-compiler-for-windows-8x...

The ccug.chm file can be found here. http://www.intel.com/software/products/compilers/techtopics/ccug.htm

asm_lan and asm_ug I could not find a working download on Intel for them.

Last but not least there is this article as well.
http://software.intel.com/en-us/articles/black-belt-itaniumr-processor-p...

kunio2012's picture
Quoting - hrfmac It is very frustrating going to the intel site and being referred to wiki as a source. Being wiki is not an authoratative source it is very discouraging to see technical advice pointint to it. I too would like to know about assembler for Intel chips. Wiki is ok, but it should never be used as a true reference due to the open source nature of the document.

So, I will ask the same question. Where here on Intel can I learn about INTEL's assembler language.

What I found after this post here on Intel is
http://software.intel.com/en-us/articles/intel-c-compiler-for-windows-8x...

The ccug.chm file can be found here. http://www.intel.com/software/products/compilers/techtopics/ccug.htm

asm_lan and asm_ug I could not find a working download on Intel for them.

Last but not least there is this article as well.
http://software.intel.com/en-us/articles/black-belt-itaniumr-processor-p...

Thanks for linking to that hrfmac. :)
I was looking for more information about this but those links on Wikipedia that mt2 posted weren't very helpful.

knujohn4's picture
There is no easy way to learn assembler programming. If you know to program in a high level language it is doable with some work. If you do not know any programming, start with a fairly simple high level language. Intel does not as far as I know have much documentation about how to program in assembler, but they do of course have complete documentation about the instruction set of modern processors. You need to do quite a bit of programming (!) before going into specific use of the various SIMD (MMX, SSE, SSE2 ... etc) extensions to the instruction set.

Most compilers recognize some form of inline assembler statements, but to get into the details you probably need a proper assembler with tools. Some older versions of Microsoft Macro Assembler is available for free from Microsoft, or you could use the NASM assembler, which also can produce programs for many platforms.

All basic level assembler program is in principle independent of platform, but to really produce working programs you need detailed information about the systems Application Programming Interface (APIs), Windows or Linux or something else.

I recomend you find a book on assembler programming targeted to your platform, but a lot of information is available on the internet. It just takes a while to sort out.

Intel's documentation is here: http://www.intel.com/products/processor/manuals/index.htm

Information on Intel's compilers are here: http://software.intel.com/en-us/intel-compilers/

Microsoft has a free compiler suite (Express Editions) available: http://www.microsoft.com/exPress/

and you can download the Macro Assembler to use with them : http://www.microsoft.com/downloads/details.aspx?familyid=7A1C9DA0-0510-4...

You can find information about NASM here: http://www.nasm.us/
Binaries and source code is available for NASM!

It is a challenge to program in assembler, but it is fun!
Enjoy.

Knut Johnsen

Michael Klemm (Intel)'s picture
Quoting - Alok Alan i'am new to computer programming in general and assembly language programming in particular.please guide me on how to begin programming in assembly language.

thanks

Hi!

Maybe that's not the best way of learning a specific assembly language, but I learned a lot about assembler programming by reading books about compiler constructions. It really helps understand how to write assembly code if you know what a compiler does to your functions and how the memory is used by the compiled programs. Reading the books, you can easily skip the parsing and semantic analysis stuff and directly proceed to the code generation chapters.

After understanding how to map high-level code (your algorithm in the brain :-)) to low-level assembly, it's easy to learn the syntax of various assemblers and their mnemonics. The hardest part IMHO is to understand the way you need to think about what needs to happen in themachine.

Cheers,
-michael

strictlymike's picture

A few things that helped me learn more about assembly language programming:

1. Making the compiler produce assembly language output ofmy simple C programs (with gcc, for example, it's gcc -S xyz.c). It can be illuminating to place an asm("nop"); C statement before and after a C function call, or a loop, or whatever you're interested in. In the assembly output, the statements you are interested in will be surrounded by this assembly code:

#APP
    nop
#NO_APP

2. Disassembling C programs I've written, using `objdump -d
' and `objdump -S
'. The -d argument will just disassemble it, but the -S argument will disassemble it side-by-side with the relevant C statements, if I recall correctly.

3. Reading the Wrox Press book, "Professional Assembly Language"--I found it to benice and technical.
http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764579010.html

4. Downloading and referring to the Intel Software Developer's Manual (all 5 PDFs).
http://www.intel.com/products/processor/manuals/

Good luck!

bigbobtwo's picture

I agree, the Wrox Press book, "Professional Assembly Language" has been very helpful for me as well. Wikis can be a decent resource to a certain extent. more What really helped me was just coding stuff on my own. Learning by doing is unbeatable in this field.

The Intel Software Developer's Manual is a good reference and should be looked at if you have some C experience.

jose-maria-gomez-vergara's picture

Login to leave a comment.