I just finished learning assembly language. But I couldn't understand what could I implement (for practice/like small project). Would be great if its something useful for anyone.
Today, assembly language is still used for direct hardware manipulation, access to specialized processor instructions, or to address critical performance issues. Typical uses are device drivers, low-level embedded systems, and real-time systems (see § Current usage).
Originally Answered: Is assembly language still useful to learn in 2021? yes. most embedded applications require some amount of assembly (low level code) to directly interface with hardware devices.
x86 assembly language is the name for the family of assembly languages which provide some level of backward compatibility with CPUs back to the Intel 8008 microprocessor, which was launched in April 1972. It is used to produce object code for the x86 class of processors.
Assembly languages are also often used by programmers wanting greater control over their computers as assembly languages allow you to directly manipulate your hardware. Because of its speed and importance, some programs are specifically written using assembly language as the code can usually remain smaller.
One of my favorite hobbies is Reverse Engineering.
It requires a solid knowledge of assembly and the use of disassemblers/debuggers to walk through compiled code. This allows you to alter, understand and reverse compiled programs. Each new program is like a puzzle waiting to be solved!
For example, a lot of people reverse games like Minesweeper when they are first starting out.
Here is a screenshot of a key section of code in Minesweeper I reversed awhile back (comments on right-hand side):
This was located by placing a breakpoint on calls to the rand()
function and stepping backwards in the callstack. After some digging it becomes obvious that:
With this knowledge it becomes easy to determine the location of any given mine in the minefield by:
cellAddress = mapBaseAddress + (32 * (y+1)) + (x+1);
Then, with a simple loop and some calls to ReadProcessMemory()
you've got the ultimate Minesweeper hack!
Reading hand-written assembly is far easier than reading machine generated assembly. Modern compilers do some magical and crazy things to the code for optimization that can sometimes be difficult to follow. So, this will definitely push your assembly knowledge!
There are tons of activities that can branch off from this:
And more!
If you are interested, I highly suggest the book: Reversing: Secrets of Reverse Engineering
You can learn how OS work at low level (interrupts, virtual memory and so on). First write a bootloader which will give you full access to the hardware, then you can start playing with protected mode, VGA programming and so on.
Two good resources:
http://wiki.osdev.org/Main_Page
http://www.osdever.net/FreeVGA/home.htm
[Edit]
If you want to learn about optimizations, check out Agner Fog's website: http://agner.org/optimize/.
[Edit]
Copied from Simucal's comment:
You might want to add a link to MikeOS also. It is a small operating system written in Assembly that is designed as a learning tool to see how simple operating systems work. It has well commented code and documentation: http://mikeos.berlios.de
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With