Computer Organization and
Assembly Language
Lecture 24
Physical Address Calculation
16-bit segment 16-bit offset
0000 0000
20-bit segment 20-bit offset
+
20-bit Physical Address
Address Calculation
1 D D D 0
0 0 1 0 0
+
1 D E D 0
20 –Bit Physical Address Calculation
Segment Base
16 – Bit Segment Register Value
0 0 0 0
0 0 0 0 0
20 – Bit Segment = 0 Decimal
Segment Base
16 – Bit Segment Register Value
0 0 0 1
0 0 0 1 0
20 – Bit Physical Address = 16 Decimal
Physical Address Calculation
[bx+0x7000] BX = 0x9100
DS = 0x1500
Effective Address =
EA = Base + Index + Offset
= 0x9100 + 0x0000 + 0x07000
= 0x10100 ; 17-bits !
= 0x0100 ; Segment wrap
; around
Physical Address Calculation
[bx+0x7000] BX = 0x9100
DS = 0x1500
Effective Address =
EA = 0x0100 ; Segment wrap
; around
Physical Address = Segment*0x10+EA
= 0x1500*0x10+0x100
= 0x15100
Physical Address Calculation
[bx+0x0100] BX = 0x0100
DS = 0xFFF0
Effective Address =
EA = Base + Index + Offset
= 0x0100 + 0x0000 + 0x0100
= 0x0200
Physical Address = Segment*0x10+EA
= 0xFFF0*0x10+0x0200
= 0x100100 ; 21-bits !
= 0x00100 ; memory wrap
; around
Segment Override Prefix
Instruction Opcode
mov ax,[cs:bx] 2E9B07
mov ax,[es:bx] 268B07
mov ax,[ss:bx] 368B07
mov ax,[bx] 8B07