{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Chapter4 Address - Chapter 4 Operand Addressing Modes ELEC...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
ELEC 2220 – Computer Systems Chapter 4 Operand Addressing Modes
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
ELEC 2220 Computer Systems Operand addressing modes Ways to specify operands for an instruction: Inherent : operand location is implied by the instruction mnemonic Immediate : operand immediately follows instruction code in memory Memory : operand must be read from or written to a designated memory address Direct – specify the memory address directly Indirect – specify a way to determine the address
Background image of page 2
ELEC 2220 Computer Systems Inherent (Register) Addressing No “operands” listed with the instruction No memory is accessed Operand is in a default register. clra ; 0 a aba ; a + b a decb ; b - 1 b inx ; x + 1 x EXAMPLE 2-9 0000 1806 1 aba ; A + B -> A 0002 08 2 inx ; X+1 -> X 0003 B781 3 exg a,b ; A <-> B Source: Cady/Sibrigoth “Software and Hardware Engineering
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
ELEC 2220 Computer Systems Immediate addressing. Figure 4-4 Data immediately follows op-code in memory. Op-code Data If 16-bit data, then the op-code is followed by first the high byte, and then the low byte of the data. “big endian” format N N+1 Address:
Background image of page 4
ELEC 2220 Computer Systems Example 4-2 Immediate Addressing 0000 8640 1 ldaa #64 ; Decimal 64 -> A 0002 8664 2 ldaa #$64 ; Hexadecimal 64 -> A 0004 CE1234 3 ldx #$1234 ; Hexadecimal 1234 -> X Program addresses Instruction codes “Source” assembly language statements. Created by the assembler Note: CASM12 designates decimal by ! (example: !64) Code Warrior and most other assemblers assume decimal by default (no special designator). Source: Cady/Sibrigoth “Software and Hardware Engineering
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
ELEC 2220 Computer Systems Immediate addressing with labels Value1 equ $34 org $0800 Bob: dc.1 $56 ……… ldaa #Value1 ; $34 a ldx #Bob ; $0800 x ldaa Bob ; $56 a (Extended) ldaa 0,x ; $56 a (Indexed) Label “Bob” is a symbolic reference to address $0800. After “ldx”, register IX also contains address $0800.
Background image of page 6
ELEC 2220 Computer Systems Direct/Extended Addressing The instruction “directly” specifies the address of the operand The address of the operand follows the op-code in memory “Extended” => full 16-bit address “Direct” => address range $0000-$00FF. Instruction includes only low byte of address Examples ldaa $1000 ;extended ldaa $45 ;direct
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
ELEC 2220 Computer Systems Extended memory addressing.
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}