- #1
david2
- 35
- 84
You guys still use assembly when programming these days?
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.Assembly language is a low-level programming language that uses mnemonic codes to represent machine instructions. It is specific to the processor architecture and requires a deep understanding of computer hardware.
Yes, assembly language is still used in certain applications, especially those that require direct hardware control and optimization. It is also used in the development of low-level system software, such as operating systems and device drivers.
Assembly language allows for precise control over hardware resources, resulting in highly efficient code. It is also relatively fast to execute and can handle complex tasks that other high-level languages may struggle with.
Assembly language is difficult to learn and can be time-consuming to write and debug. It is also not portable, meaning that code written for one processor may not work on another. Additionally, it is not as readable or maintainable as high-level languages.
Yes, many computer science and engineering programs still include courses on assembly language. It is seen as an important foundational skill for understanding the inner workings of computers and developing low-level software.