Sign in to follow this  
comfortablynumb84

A question about assembler

Recommended Posts

Is assembler still used today? I mean.. games are still programmed with C++ in combination with assembler? If this is the case.. could you give me some tutorials links or a few good books to buy? thanks :)

Share this post


Link to post
Share on other sites
TheUnbeliever    963
Assembly language is still used in various specific areas:


- Systems software development -- use of assembly language, or compiler
intrinsics, is necessary at times because you require access to certain
instructions which aren't normally available
- Embedded systems or similar systems where space is of a premium -- however, C
and/or C++ are also often used here, albeit it with certain caveats
- Optimization (directly using SSE, say) in performance-intensive programs
where profiling has indicated
that a boost would be gained from rewriting
a portion of the code which is running slowly in assembly language and
the developer is skilled enough to gain a boost from doing so

Share this post


Link to post
Share on other sites
Gumgo    968
It is used in games (or programs) if there is a function that needs to be fast but is slower in C++, or whatever other language you are using. For example, I downloaded a "Mandelbrot set generator" that was written in asm because it runs a lot faster.

Share this post


Link to post
Share on other sites
TheAdmiral    1122
Assembly language (and it is assembly, not 'assembler') is useful, indeed essential, just not for high-level programmers. The world of computing wouldn't go 'round without assembly programmers - how else would we produce our C++ compilers? (Please don't take that too seriously) You just need to realise that an important programming mantra is to use the highest-level language you can get away with.

If you're coding the cross-platform interfacing component of a hardware driver, you have no choice but to get involved with ASM, but if you're writing user-mode applications, you should probably stick with what you're used to.

Admiral

Share this post


Link to post
Share on other sites
ds2systems    122
This topic has been beat to death, but it is still irresistable. I would encourage any programmer to learn assembly. I think that the most important advantage to understanding assembly is a deeper understanding of how the processor and its peripheral work and interact.

A few uses for assembly I can think of off the top of my head are:
1) Timing
2) Optomizing mathmatical routines using SIMD
3) Speeding up work with large memory buffers

There are, of course, the obvious driver development and operating system development examples.

Learning assembly on a PC these days is difficult for several reasons. Much of the material is outdated and modern operating systems (i.e. Win95+) run in protected mode and do not permit direct access to many of the IO ports and interrupts.

I guess the point of all this is to say that perhaps a fun way to learn assembly would be to start with microcontrollers first. Look up PIC16F84 on Google. This will turn up all kinds of electronic projects and documentation. A good resource for electronic parts is www.digikey.com.

Share this post


Link to post
Share on other sites
I've been searching on google for a while and I found a lot of webs about it. I just need to know something. Is there any assembly compiler that is updated almost every six months? What compiler should I download? NASM is ok?

Thanks a lot =)

Share this post


Link to post
Share on other sites
Crypter    748
"Assembly compilier" is tecnically an incorrect term.

"Assembly Language" is the language, An "Assembler" is the er. 'compilier'.

I personally like NASM. Alongside NASM, MASM is updated often as well
(I believe so, anyway).

Share this post


Link to post
Share on other sites
ds2systems    122
What I have used mostly is inline assembly in C++ in Visual Studio. I have used A86/386, NASM, MASM, and a host of other other compilers in the past. Lately, I have mainly used inline assembly in Visual Studio on the rare occassions I need assembly. In answer to your question, I would recommend NASM as I believe there is a larger community.

There are some tutorials out there on writing a SIMPLE OS (like just enough to tell the BIOS your bootable and execute your code). This could provide a good test bed for your code. If you are interested and have trouble finding the tutorials, let me know and I'll help.

As a side not: Assembly compiler is technically correct. I didn't flinch (too much) when I saw it. The only reason it would make a difference what you call it is when searching for one on Google. In this case, use "Assembler." Of course, once you get cracking, you'll figure all this out.

Good luck

Share this post


Link to post
Share on other sites
AIDev    190
Quote:
Original post by comfortablynumb84
Humm.. I've a problem with english terms hehe.


Don't worry about it -- those terms are VERY frequently mixed up on these boards, among English speakers and non-English speakers. There is a 1:1 translation between statements in assembly language and machine code (in the pure sense -- many assemblers have preassemblers nowadays for simple tasks like IF), and so the language is "assembled" rather than "compiled". As you can imagine, it is very easy to write an assembler as compared to a compiler!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this