3 ms·
1. When you have no choice in languages: Homebrew development for, say, the Nintendo Game Boy happens by and large in assembly language. 2. Optimization: Some
by beefhash 8y ago
1. When you have no choice in languages: Homebrew development for, say, the Nintendo Game Boy happens by and large in assembly language.
2. Optimization: Some critial code sections or cryptographic operations can be massively sped up with hand-crafted assembly[1].
3. Obfuscation: Sometimes, you have to drop to assembly for obfuscation. This is especially the case if you need to/want to fool the Hex-Rays Decompiler. Applications include malware and digital rights management (some might argue the latter is just a sub-species of malware). This also includes writing your own custom assembly language for a custom virtual ISA for the purpose of code obfuscation.
4. Embedded platforms: Some very obscure microcontrollers may only have support for pure assembly, though at least C89 compilers being available seems to be the norm.
5. Education: It can be very enlightening to understand how things work below your "home" layer of abstraction. Some parts of C seem to be much easier to understand once you have a firm grasp on a common assembly language.
6. Compilers: Self-evident, you kind of have to understand the code you emit.
[1] See e.g. this benchmark https://monocypher.org/speed https://monocypher.org/speed -- authenticated encryption on libsodium gets an improvement of over 300% from hand-crafted assembly over the portable C implementation
- saagarjha 8y agoAnother common use case is for writing shellcode and other exploit-related work.