Master the fundamental concepts of x86 assembly (intel syntax) through this focused micro-challenge.
Single Instruction Multiple Data (SIMD) is where ffmpeg, BLAS, and simdjson get their speed. SSE uses 128-bit xmm registers: four float lanes in parallel. AVX widens to 256-bit ymm; your exercise stays with SSE basics in NASM.
nasmLoading…
align 16 in .dataA scalar loop issues one add per element; SIMD issues one add for four. Auto-vectorization in Clang often fails on pointer aliasing, which is why hot paths stay hand-written.
For this exercise, you will add two four-element float arrays with SSE and store the result. This task asks you to verify alignment before movaps, because unaligned SSE on older cores faults and on modern cores still hurts throughput.
Keep the relevant man page, ABI doc, or Rust reference chapter open while you work. When your output disagrees with the reference implementation on the same machine, the mismatch is usually an alignment rule, an off-by-one terminator, or a register slot you misread in GDB. Skim the official documentation for the tool or ABI named in the exercise; the prose changes, but register roles, syscall numbers, and ownership rules stay stable across releases.
Use SSE SIMD instructions to perform vectorized operations.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github