From WikiChip
immediate value
Revision as of 21:57, 13 July 2014 by 172.2.49.154 (talk) (Created page with "An '''immediate value''' (or simply an '''immediate''' or '''imm''') is a piece of data that is stored as part of the instruction itself instead of being in a memory locat...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

An immediate value (or simply an immediate or imm) is a piece of data that is stored as part of the instruction itself instead of being in a memory location or a register. Immediate values are typically used in instructions that load a value or performs an arithmetic or a logical operation on a constant.

Overview

Under most instruction set architectures, various instructions can also perform operation on constant values. For example consider an ISA that can add two registers and store the result in a third register:

add r3, r2, r1       ; r3 = r2 + r1

The instruction set may also support the common case of adding a constant value (such as in the case of many programming languages that support ++var).

add r1, r1, 1       ; r1 = r1 + 1

In the code above, the value 1 is an immediate value that gets encoded in the add instruction itself.