Assembly Language Step-by-Step: Programming with Linux
Rate it:
Read between January 1 - February 21, 2019
14%
Flag icon
A computer architecture that stores the least significant byte of a multibyte value at the lowest offset is called little endian. A computer architecture that stores the most significant byte of a multibyte value at the lowest offset is called big endian.
14%
Flag icon
So, which “endianness” do Linux systems use? Both! (Though not at the same time…) Again, it's not about operating systems. The
21%
Flag icon
The Joy of X by Niall Mansfield
22%
Flag icon
The -k option instructs Make to stop building any file in which an error occurs and leave the previous copy of the target file undisturbed.
23%
Flag icon
The x86 architecture is “little endian,” meaning that the least significant byte in a multibyte sequence is stored at the lowest address. This applies to registers as well,
25%
Flag icon
numeric values. Signed values, of course, are values that can become
28%
Flag icon
This is a requirement of the Linux operating system. Every executable program for Linux has to have a label _start in it somewhere, irrespective of the language it's written in: C, Pascal, assembly, no matter. If the Linux loader can't find the label, it can't load the program correctly. The
28%
Flag icon
In Linux text work, the end-of-line (EOL) character has the numeric value of 10.
29%
Flag icon
Unless the stack is completely empty, SP points to real data, not empty space.
31%
Flag icon
A working program is not necessarily a finished program.
32%
Flag icon
Learning is a messy business, and no matter how good you think you are, you will always be learning.
34%
Flag icon
One non-obvious use of XOR is this: XORing any value against itself yields 0.
39%
Flag icon
LEA enables you to calculate the effective address of any element in a table (or any calculable address at all!) and drop that address in a register.
47%
Flag icon
Local labels, unfortunately, are not accessible as breakpoints from the command-line interface of the Gdb debugger.
47%
Flag icon
Here's a rule of thumb that I use: local labels and all jumps to them should occur within a single screen of code.
47%
Flag icon
NASM to generate opcodes for short jumps by default. In fact, NASM generates opcodes for short jumps unless you explicitly tell it to use near jumps.
55%
Flag icon
It's a simple trade-off to understand: think macros for speed and procedures for compactness.
60%
Flag icon
Bhaskar Chowdhury
:)
62%
Flag icon
Bhaskar Chowdhury
yup
62%
Flag icon
Beginning with the 2.6 version of the Linux kernel, the kernel “randomizes” the boundaries of the stack.
64%
Flag icon
REPE will end the instruction when its comparison clears ZF to 0.
65%
Flag icon
Bhaskar Chowdhury
so very true
65%
Flag icon
gcc governs both the assembly step and the link step.
65%
Flag icon
what gcc really does is act as master controller for several GNU tools, supervising a code assembly line that you don't need to see unless you specifically want to.
65%
Flag icon
Sixty-four-bit integer values are returned in EDX and EAX, with the low 32 bits in EAX and the high 32 bits in EDX.
65%
Flag icon
Parameters passed to procedures are pushed onto the stack in reverse order.
65%
Flag icon
The registers that cannot be changed by a Linux application linked to C functions are EBX, ESP, EBP, ESI, and EDI.
65%
Flag icon
One compiler mechanism that does bear on Linux assembly work is that of the stack frame. Compilers depend on stack frames to create local variables in functions,
67%
Flag icon
RESB directive just sets aside space for your variable.
70%
Flag icon
In a sense, assembly language is an intermediate language used for the C compiler's benefit.
71%
Flag icon
In NASM, a named string variable is considered a variable and not a literal.
71%
Flag icon
a memory location (as distinct from referencing its address) is done by enclosing the location of the address in square brackets, like so: mov ax, dword [ebp]
74%
Flag icon
The argument count goes into EDI. The address of the argument table goes into EBX.
75%
Flag icon
A file handle is a 32-bit number assigned by Linux to a file during the call to fopen().
78%
Flag icon
The point is not to conquer the subject, but to live with it, and grow with your knowledge of it.