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

2 Addressing Modes Address Register Indirect (An)
operand is written as (An) the address of the data is in the address register <ea> = (An) instruction registers memory

3 Indirect Addressing … initializing An
to load an address into an address register 1. 2. the following will not work: MOVEA.L NUM,A1 MOVE.L NUM,(A1) Assume: A1 contains $3000, and ORG $600 NUM DC.L 2005

4 e. g. Write a program to count the number of 6’s in a list
e.g. Write a program to count the number of 6’s in a list. The number of items in the list is provided. input: list_len = 20 list = 1,6,4,5,5,6,2,5,6,7,6,6,6,1,3,5,9,6,7,5 output: algorithm:

5 e. g. Sum the numbers in an array given the length of the array
e.g. Sum the numbers in an array given the length of the array. [To be added later: check if there is data and if sum is in range.] input: array array_l output: sum algorithm:

6 Expectations: you can use both the LEA and MOVEA techniques to correctly initialize an address register for use with indirect addressing later, you can do the above initialization to traverse the list/array in either direction you can use indirect addressing correctly you can do operations on the data in a list, e.g. find min/max, count, arithmetic operations


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

Similar presentations


Ads by Google