Skip to content
University of California, Davis Mechanical and Aerospace Engineering
ARMS Laboratory
EME154 · Interactive Lab

Write it. Load it. Watch it run.

Real AVR instructions, visible memory, one operation at a time. Based on the ATmega328P used by the Arduino Uno.

READY

Word addressOpcodeInstruction / operand

Each row holds one 16-bit word. LDS and STS occupy two rows. Select an instruction to read its explanation.

PC selects the next wordHighlighted rows form one instruction
Arithmetic logic unit
Waiting for arithmetic
All 32 registers

Scroll to browse every byte, or enter an address above to jump to it. Select a cell for the enlarged view below. Read and write labels follow execution.

Read the manual

For the selected instruction

This explanation uses the CPU's current values. Selecting a row does not move the PC.

Guided starting values
Execution history
    Memory map & teaching notes
    Data byte addressesContents
    0x0000–0x001FR0–R31
    0x0020–0x005FI/O registers
    0x0060–0x00FFExtended I/O
    0x0100–0x08FF2 KB SRAM

    Flash has a separate address space: 32 KB, or 16K instruction words. Fetch and execute are teaching pauses, not separate hardware clock cycles. The displayed PC is held during fetch and updated after execute.

    Only the listed instruction subset is modeled. SRAM addresses outside the permitted range are rejected even though LDS/STS encodings can represent other addresses. A real CPU does not automatically stop at the end of this listing.

    The guided example uses R1 as an addend. Arduino's compiler normally reserves R1 as a zero register. This is standalone assembly simulation, not inline assembly for an Arduino sketch.

    What the flags mean

    C unsigned carry (ADD) or borrow (SUB/CPI); Z zero; N result's sign bit; V signed overflow; S N XOR V; H carry/borrow across bit 3. DEC preserves C and H. Loads, stores, moves, and branches preserve all flags.

    I and T are not displayed or changed by this instruction subset. BREQ/BRNE test the most recent Z flag, not the register contents directly.