How Can I Determine the Effective Address in Assembly Language?

  • Thread starter Thread starter Ald
  • Start date Start date
  • Tags Tags
    Assembly
Click For Summary

Discussion Overview

The discussion revolves around determining the effective address in assembly language instructions for the MC68hc12 processor. Participants explore the concept of effective addressing, its implications in assembly instructions, and seek clarification on how to analyze specific instructions and their effects on registers and memory.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant expresses confusion about the concept of effective address, noting that their textbook does not define it.
  • Another participant suggests that understanding the specific commands and parameters of the MC68hc12 processor is essential for determining effective addresses.
  • A participant defines effective address as the actual address used for an instruction's operand, referencing its use in instructions like Load Effective Address (LEA) on Intel CPUs.
  • Several participants inquire about how to determine the effective address and the contents of affected registers for specific assembly instructions provided in the thread.
  • There is a discussion about the meaning of the '#' symbol in assembly language, with one participant suggesting it indicates an immediate value.

Areas of Agreement / Disagreement

Participants generally agree on the definition of effective address as the address of the operand, but there is no consensus on how to apply this understanding to the specific instructions listed. Confusion remains regarding the execution process and the effects on registers.

Contextual Notes

Participants note a lack of resources and definitions in their textbooks, which may limit their understanding of effective addressing and its application in the context of the MC68hc12 processor.

Who May Find This Useful

This discussion may be useful for students learning assembly language, particularly those working with the MC68hc12 processor and seeking to understand effective addressing in assembly instructions.

Ald
Messages
24
Reaction score
1
I am suppose to determine the effective address if the instruction below and the contents of any affected register (except the PC) or memory location after each of the instructions in problem is executed. Assume the initial state (in hex) of the CPU and memory before every instruction is as follows: Processor is MC68hc12.
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 textbook didn't even define effective address. Could someone provide a little explanation on this or point me to some simple explanation of the concept.

Thanks
 
Last edited:
Technology news on Phys.org
Each CPU type will have a slightly different machine language so you should first try to determine what commands the two instruction lines are executing. Typically CPUs take in instructions which contain the command type and command parameters, e.g. <command type> <parameter 1> <parameter 2>. Also, find out what the segment registers are, etc.

You need to do some reading on the processor.
 
The latextlab site seems to be down any other suggestions for information. This is an assignment from the 1st chapter of a MC68hc12 book. It doesn't explain effective addressing, just uses the term. I'm totally lost.
Thanks for your help.
 
Effective address just means the actual address used for an instruction's operand, or when the address itself is the operand, as in the case of the Load Effective Address (LEA) instruction on Intel cpu's.
 
Thanks, so in the instructions below the effective address is in the operand, correct? How do I determine the address and affect registers?

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: Processor is MC68hc12.
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
 
Last edited:
Ald said:
Thanks, so in the instructions below the effective address is in the operand, correct?
The effective address is the address of the operand. Assuming # means immediate, then it's a special case.

How do I determine the address and affect registers?
Go through the process that the cpu would go through.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K