david2
- 35
- 84
You guys still use assembly when programming these days?
Assembly language continues to be utilized in modern programming, particularly in embedded systems and performance-critical applications. Tools like MSFT Visual Studio support embedded assembly in 32-bit code, while legacy systems often combine COBOL and HLASM for financial applications. Notably, assembly is essential for optimizing CPU-intensive tasks, such as graphics rendering and audio processing, where modern compilers may not achieve the same efficiency. Projects like asmFish demonstrate the potential of assembly in optimizing complex algorithms, showcasing its relevance in contemporary software development.
PREREQUISITESSoftware developers, embedded systems engineers, and performance optimization specialists interested in leveraging assembly language for critical applications.
Which one can do relatively easily by using assembly code embedded in C or C++ code. I use MSFT Visual Studio, which supports embedded assembly in 32-bit code, but doesn't allow it in 64-bit code. The workaround is to have a separate assembly file that gets assembled and linked to the rest of your code.newjerseyrunner said:Not very often, but sometimes when I'm profiling I see a chunk of code that I know will be faster if I just convert it to assembly.
Not too many years ago I saw some assembly code in Windows video drivers, an obvious effort to speed up how pixels are updated as quickly as possible. I've also seen some assembly code using MMX extensions that was used in processing audio streams.rcgldr said:As already posted, some aspects of operating systems, such as context switching, interrupt handling, are written in assembly.
There are some specially tuned examples of assembly code, like this 600+ line assembly code for fast crc16 or crc32:Mark44 said:Not too many years ago I saw some assembly code in Windows video drivers, an obvious effort to speed up how pixels are updated as quickly as possible. I've also seen some assembly code using MMX extensions that was used in processing audio streams.
Agreed, but not always the most effective code.rootone said:Modern compilers produce very effective machine code.
This is not the only case, as @Rive points out below.rootone said:Only in the case of writing drivers for unique hardware could human written machine code be an improvement.
Rive said:So at the end, the core of almost every CPU intensive code contains assembly. And when your game is running, 90% of the load generated by the 3D engine will run on assembly. When you render something, it's the same. Convert some videos? That's the same too.
Modern compilers are indeed quite good and can produce code which usually are more optimal than an assembly code written by any average programmer.rootone said:Modern compilers produce very effective machine code.
Only in the case of writing drivers for unique hardware could human written machine code be an improvement.
DCL ASMSUB1 EXTERNAL ENTRY OPTIONS (ASM, INTER, NOMAP); ##-## that declaration allows me to reference a separately assembled routine, in this instance called ##\mathtt{ASMSUB1}##, that is by the PL/I compiler given a ##\mathtt{VCON}## placeholder, which is resolved by the linkage editor when the complete module is built.