Samina Jabeen
Samina Jabeen

Reputation: 33

How to calculate physical address from this assembly instruction?

Following are the register values for Intel microprocessor:

CX: FF0A

BX: AB5D

DI: BDEF

DX: 1234

DS: CC20

SP: CD0F

Instruction:

  1. ADD [BX+DI], CX

  2. MOV DX, [SP+1652H]

I want to know how to calculate the physical address of the above mentioned two instructions.

Upvotes: 1

Views: 4720

Answers (1)

Zeshan Sajid
Zeshan Sajid

Reputation: 559

For 1. ADD [BX+DI], CX You will need to calculate the Effective Address first.

Effective Addressing = Base + Index + Offset

Then, the physical addressing would be: Physical Addressing = segmentation * 0x10 + The Effective Addressing

In your case, Base will be the value of bx, index will be the value of di, and offset will be empty. Now calculate by yourself.

Upvotes: 1

Related Questions