Presentation is loading. Please wait.

Presentation is loading. Please wait.

Addressing Modes Immediate #<data> or Imm

Similar presentations


Presentation on theme: "Addressing Modes Immediate #<data> or Imm"— Presentation transcript:

1 Addressing Modes Immediate #<data> or Imm
data is part of the instruction Register Direct Dn or An data is in a register the register number is part of the instruction Memory Direct (xxx).W or (xxx).L data is in a memory location the address of the memory location is part of the instruction Address Register Indirect (An) the address of the data is in the address register

2 Address Register Indirect … variations
Autoincrement (An)+ address register indirect with postincrement operand is written as (An)+ the address of the data is in the address register registers memory address data instruction

3 Address Register Indirect … variations
Autodecrement -(An) address register indirect with predecrement operand is written as -(An) the address of the data is the contents of the address register minus the decrement registers memory instruction address data

4 Postincrement and Predecrement
going backward MOVE.B list_l,D0 loop2 NEG.W -(A0) SUBQ.B #1,D0 BNE loop2 … list_l DC.B list DC.W ,2,4,0 count DS.B 1 going forward LEA list,A0 MOVE.B list_l,D0 loop1 NEG.W (A0)+ SUBQ.B #1,D0 BNE loop1 … * where is A0 positioned?

5 e.g. Determine the number of negative elements in a series of signed 16 bit numbers. Length of array is provided. input: output: algorithm:

6 Reading: Expectations:
M /16-/32-Bit Microprocessors User’s Manual [pdf, 184p; Motorola] -- Table 2-1. Data Addressing Modes, from section 2.2, the <ea> information is correct MOTOROLA M68000 FAMILY Programmer’s Reference Manual [pdf, 646p; Motorola] -- Section 2 Addressing Capabilities: subsections covers indirect addressing; note that the diagram and the <ea> information in is wrong as it shows address register indirect with preincrement not postincrement Expectations: you can use LEA and MOVEA to correctly initialize an address register to traverse the list/array in either direction you can use indirect addressing variations correctly and to your advantage


Download ppt "Addressing Modes Immediate #<data> or Imm"

Similar presentations


Ads by Google