Friday, October 12, 2007

Instruction Fetching

How data being fetched to the CPU?

To execute MOV AX,[BX] where DS = 2500H and BX = 3000H
- Physical Add: 25000H + 3000H = 28000H, that is an even address.
- For Intel 8086 with 16-bit data bus, thus the contents of memory
locations 28000H and 28001H will be fetched into the CPU in one
memory cycle.
- The low byte goes to the low address (28000H to AL) and the high
byte goes to the high address (28001H to AH).

To execute MOV AX,[BX] where DS = 2500H and BX = 3005H
- Physical Add: 25000H + 3005H = 28005H, that is an odd address.
- Here, two consecutive memory cycles required to access memory
contents: In the first cycle, the 16-bit data from 28004H and 28005H is
accessed and in second cycle, the 16-bit data from 28006H and
28007H is fetched. However, only the contents of 28005H and
28006H are used, and the contents of 28004H and 28007H are
discarded.
- Thus, the contents of memory location 28005 goes to AL and the
contents of memory location 28006H to AH.

To execute MOV AH,[BX] where DS = 2500H and BX = 3005H
- Physical Add: 25000H + 3005H = 28005H, that is an odd address.
- Here, the contents of memory locations 28004H and 28005H
both are accessed with one memory cycle.
- However, only the contents of memory address 28005H are fetched
into register AH.

1 comment:

Perokok Soleh said...

salam..
leh tnyer ckit....
kalo nak wat komik leh pakai computer biasa tak??
kalo bolehh,kita nak kena pakai software aperr erk?