Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

In the usual processor-architecture sense, a load reads a value from memory into a processor register; a store writes a value from a register to memory. They are opposite directions of data transfer. The exact meaning depends on the context: in JVM bytecode, for example, load and store move values between local variables and the operand stack.

How load and store work in a processor

Memory holds data at addresses; registers are small storage locations inside the processor that instructions can use directly. A load takes data from an addressed memory location and places it in a register. A store takes data held in a register and writes it to an addressed memory location.

In MIT OpenCourseWare’s Beta load-store architecture example, LD reads the value at an effective address and puts it in a register, while ST writes register data to that address. In that architecture, these are the only instructions that access memory values. The Beta example calculates the effective address from a register value plus a sign-extended 16-bit constant encoded in the instruction; other architectures may calculate addresses differently. MIT OpenCourseWare: Computation Structures.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Load vs. store at a glance

Operation Data moves Typical purpose
Load Memory address → register Make a value in memory available to processor instructions
Store Register → memory address Save a register value to memory

The arrows describe the conventional processor-level meaning. They do not mean that every programming environment uses the words for the same source and destination.

How the terms differ by context

LLVM intermediate representation

In LLVM IR, a load reads from the memory address supplied by a pointer operand. A store writes a specified value to the address supplied by its destination pointer. LLVM also defines variants such as atomic and volatile operations; those rules are specific to LLVM IR rather than universal definitions for CPU instructions. LLVM Language Reference: load instruction and store instruction.

Java Virtual Machine bytecode

In JVM bytecode, load and store refer to movement within an execution frame, not necessarily a direct read from or write to main memory. A load instruction transfers a value from a local variable to the operand stack; a store instruction transfers a value from the operand stack to a local variable. The JVM specification lists typed families such as iload, lload, fload, dload, and aload, along with corresponding store instructions. Java Virtual Machine Specification, Chapter 6.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Is a load the same as moving an immediate value?

No. In the usual processor terminology, a load reads data from an address in memory. An immediate-move instruction uses a value encoded directly in the instruction rather than fetching that value from a separate memory address. The exact instruction names and available forms vary by architecture. The JVM also distinguishes constant-loading instructions from its local-variable load instructions, so check the instruction set or virtual-machine specification relevant to the code you are reading.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to identify what an instruction loads or stores

  • Check the context. Determine whether the code is a CPU instruction, LLVM IR, or virtual-machine bytecode.
  • Find the source and destination. A processor load typically has a memory address as its source and a register as its destination; a processor store has a register as its source and a memory address as its destination.
  • Read the instruction’s addressing rules. The address may be calculated from registers, constants, or other architecture-specific operands.
  • Do not infer a memory access from the word alone. In JVM bytecode, load and store refer to local-variable and operand-stack transfers.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.