Difference between revisions of "Immediate Mode"
m (Protected "Immediate Mode" ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite)))
Latest revision as of 01:35, 4 December 2010
Immediate Mode instructions read (or write) one of their arguments in memory immediately following the instruction. It appears the CP1610 actually implements Immediate Mode as an Indirect Mode access, using R7 (the program counter) as the indirection register.
Immediate Mode instructions ordinarily access one word at the specified location. The Double Byte Data Flag modifies Immediate Mode instructions that read memory. Thus, the constant that follows such an instruction occupies two words of memory instead of one. For example:
; Example with Double Byte Data Flag cleared MVII #$0123, R0
$02B8 ; MVI@ R7, R0 opcode $0123 ; the immediate constant $0123
Compare that to:
; Example with Double Byte Data Flag set SDBD MVII #$0123, R0
$0001 ; SDBD opcode $02B8 ; MVI@ R7, R0 opcode $0023 ; lower 8 bits of immediate constant $0123 $0001 ; upper 8 bits of immediate constant $0123
The following instructions are Immediate Mode instructions: