Color theme
0 day streak0 XPP1
AssemblyLearn mode
MISSION 1 OF 3

Extract a packed color byte

0 XP earned
Assembly track: MasterMission: IntermediateBitwise masksRegistersHexadecimal
Before you start this master track

Binary and hexadecimal numbers, memory addresses, register widths, and signed arithmetic.

Master is the entry-background tier for this track. These three introductory x86-64 exercises cover registers, masks, shifts, and flags; completing them does not establish mastery of Assembly.

Guided code reading and debugging. Runnable coding challenges are available in JavaScript, Python, and SQL.

x
0 / 6 challenges
LEARN THE CONCEPT

Understand it, then try it.

Registers hold bit patterns. mov copies a value into its destination, which appears first in Intel syntax. AND keeps a bit only when both input bits are one. A mask of 0xFF therefore keeps the lowest eight bits and clears the rest, extracting one byte from a packed value.

mission.asm
mov eax, 0xABCDand eax, 0xFFmov ebx, eaxnop

x86-64 instruction snippets in Intel/NASM syntax, not complete OS programs. Step from the first instruction through the last in a debugger, then inspect the named registers. eax, ebx, and ecx are 32-bit registers; cl is the low byte of ecx. No console output or system calls are used.

Track the values line by line. Predict the result before running this example in your own editor.