Effective addressing with MC68hc12

Discussion in 'Embedded Systems and Microcontrollers' started by laguna92651, Sep 7, 2008.

  1. laguna92651

    Thread Starter Active Member

    Mar 29, 2008
    First class with assembly and at this point somewhat lost.

    I am suppose to determine the effective address and the contents of any affected register (except the PC) or memory location after each of these instructions are executed.

    a. LDX [10,X]
    b. LDY $100
    c. LDY #100
    d. LDY 0,Y
    e. STAB -5,X
    f. LDAB B,X
    g. LDAB [D,Y]
    h. STAA 1,-X
    i. LDY 2,X+

    Assume the initial state (in hex) of the CPU and memory before every instruction is as follows:
    ACCA = 00 ACCB = 05 IX = 0111 IY = 0100

    0100 FF E7 00 20 58 66 00 80 FF BC 10 00 9D 33 EF 76
    0110 41 CC 71 55 00 00 D3 17 11 22 A1 01 13 66 85 EE

    I don't even know how to start the problem. From what I could find the effective address is the address of the data referred to in the instruction. My text book didn't even define effective address. Could someone provide a little explanation on this or point me to some simple explanation of the concept.

    Last edited: Sep 8, 2008
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    I'm not familiar with that uC, but I think if you look up indirect addressing, where the contents of one register (usually X or Y) add/modify the value in the address register, you will begin to see what is going on. Your effective address is the base plus the register offset.