Assembly Exam Flashcards
Assembly Language
A low-level programming language that uses mnemonic instructions to represent machine code, providing a more human-readable form for programmers. Different processors have different assembly languages.
Machine Language
The binary language that microprocessors directly understand and execute. It consists of sequences of bits that encode instructions and data.
Compiler
A program that translates high-level language code (like C) into lower-level languages, including assembly and ultimately machine code. Compilers often perform optimizations to improve the efficiency of the generated code.
Assembler
A program that translates assembly code into machine code. It converts the mnemonic instructions and labels used in assembly code into the binary representation required by the processor.
x86-64
A 64-bit extension of the x86 architecture developed by AMD. It is widely used in modern Intel and AMD processors, featuring a larger register set and memory addressing space compared to its predecessors.
IA32
Intel Architecture, 32-bit, refers to the 32-bit x86 architecture commonly used before the advent of x86-64. It has a smaller register set and memory addressing capacity compared to x86-64.
Instruction Pointer (%rip)
A special-purpose register that holds the memory address of the next instruction to be executed. It acts as a program counter, guiding the flow of execution.
General-Purpose Registers
Registers that can be used for a variety of purposes, such as holding data, performing arithmetic operations, and storing memory addresses. x86-64 has 16 general-purpose registers, each 64 bits wide.
EFLAGS Register
A special-purpose register that contains flags or status bits reflecting the outcome of previous instructions. These flags are used for conditional branching and control flow.
System Call
A mechanism for user programs to request services from the operating system. It involves a specific set of instructions and conventions to trap into the OS kernel.
Stack
A region of memory used for dynamic memory allocation, storing local variables, function parameters, and return addresses. The stack grows downwards in memory as data is pushed onto it.
Stack Pointer (%rsp)
A special-purpose register that points to the current top of the stack. It is manipulated using instructions like push and pop to add or remove data from the stack.
Caller-Saved Registers
Registers whose values the caller function must save before calling another function if those values are needed after the call. The called function is free to modify these registers.
Callee-Saved Registers
Registers that the called function must save and restore before returning if it uses them. The caller function can assume these registers will retain their values across the function call.
Addressing Modes
Different ways to specify operands in assembly instructions. Examples include immediate addressing (using a constant value), register addressing (using the contents of a register), and indirect addressing (using the contents of a memory location pointed to by a register).