Assembly and Low-Level Language Fundamentals Questions

Programming and debugging at the instruction level. Covers reading and writing assembly for x86-64 and ARM (A32, Thumb, AArch64), including small hand-written routines, vector (SIMD) code and exclusive load/store atomics, registers, the stack and frame layout, prologues and epilogues, calling conventions and ABIs (System V, Microsoft x64, AAPCS), variadic calls, inline assembly and its constraints and clobbers, Cortex-M exception entry and context-switch code written in assembly, and how compilers translate and optimize source into machine code (optimization flags, inlining, tail calls, LTO, aliasing, strength reduction, virtual dispatch, memcpy lowering, stack spills). Also covers object files and linking as they affect generated code (ELF, PE/COFF and Mach-O, relocations, GOT and PLT, position-independent code, static linking, stack unwinding), the compiler backend ideas behind it (SSA, register allocation, instruction selection, peephole passes) and emitting machine code from a minimal JIT. On the debugging side: reading disassembly, using gdb and lldb for registers, frames, breakpoints and watchpoints, analyzing core dumps and stripped binaries with addr2line and build IDs, and diagnosing crashes from instruction-level state such as corrupted returns, stack smashing, ABI mismatches and optimizer-induced bugs. Debugging method in general, hardware probe tooling, malware analysis and exploit-mitigation design are covered elsewhere.

MediumTechnical
80 practiced

How does a compiler decide whether to inline a call, and what are the costs and benefits of doing so? How would LTO or profile-guided optimization change those decisions?

MediumTechnical
79 practiced

Look at the assembly generated for a C++ virtual method call. What in the instructions gives away the virtual dispatch, and what does it cost compared with a direct call?

EasyTechnical
124 practiced

Explain the meaning and practical effects of common compiler optimization flags: -O0, -O1, -O2, -O3, -Os, and -Ofast. For each, describe typical trade-offs in compilation time, code size, debuggability, floating-point semantics, and opportunities for transformations such as inlining and vectorization.

HardTechnical
69 practiced

A hot loop is slow because the compiler cannot prove two pointers do not overlap, so it reloads memory every iteration. How would you confirm that in the disassembly, what are your options, and what is the risk of promising the compiler there is no overlap?

That is every published Assembly and Low-Level Language Fundamentals question for Game Developer so far. Browse the other topics in this category, or practice this one interactively.