Why Use Assembly Language in Modern Programming?

  • Thread starter Thread starter ChrisLeslie
  • Start date Start date
  • Tags Tags
    x86
AI Thread Summary
The discussion centers on the use of assembler programming among forum members, highlighting several key points. Many participants acknowledge that assembler is primarily utilized for performance-critical tasks, such as tight loops and graphics routines, with historical examples like the Quake graphic system illustrating its significance. The conversation touches on the advantages of high-level languages (HLLs) over assemblers, noting that skilled optimizing compilers can often produce more efficient code than hand-optimized assembler due to their deeper understanding of CPU architecture. The necessity of using assembler is emphasized for specific tasks requiring precise control over machine code, such as initializing hardware or managing power states. Additionally, the quality of assemblers varies, with Linux compilers generally regarded as effective, while Microsoft’s assembler also receives positive mentions. The discussion briefly contrasts 16-bit and 32-bit architectures, although specific opinions on this aspect are less pronounced. Overall, the use of assembler is framed as a specialized skill for particular applications rather than a common practice in modern programming.
ChrisLeslie
Just curious about how many forum members use assembler programming, and:
1. what sort of assembler they may use,
2. the pros and cons of various assemblers,
3. capability of assemblers vs HLL's,
4. their thoughts on 16 vs 32 bit,
5. and why they may use assemblers at all?

Chris
 
Technology news on Phys.org
Not something I know much about but I would imagine that it'd only be used for the tightest of loops, things like shader routines for video processors and stuff. An interesting use of assembler was the graphic system in Quake, they couldn't quite get it to run well on a 486 but nevertheless I think it was a great achievement.
 
A good optimizing compiler (and there are a lot of bad ones!) should be able to generate code that runs tighter than "simple-minded" hand-optimised assembler, because the compiler writers should know more details about exactly how the CPU works than most application programmers. For example, reordering instructions to get maximum overlap of fetch-execute, look-ahead branch resolution, optimum use of the cache, etc.

I suspect the main reason for using an assembler now would be if you need to generate some precise sequence of machine code instructions for some reason - for example at power on reset, or putting the CPU into "sleep mode" and waking it up again.
 
My brother-in-law used assembly for chip level programing, if you ahve to make a process work in micro-seconds you use assembly. Th Linux compilers are pretty good, last time i tried the microsoft version of assembly lanugauge wasn't too bad either.
 
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top