banner



What Value Would You Load Into The Segment Register To Access Physical Memory With Offset

features of 8086 ( continued)

- 8086 has 16 bit registers

- 8086 has multiplexed accost & data motorbus

- 8086 operates in ii modes , minimum( single processor )

& maximum (multi processor) modes

compages (continued)

l the 8086 has 2 parts , the motorcoach interface unit (biu) and the execution unit of measurement (eu).

50 the biu fetches instructions, reads and writes data, and computes the twenty-bit address

l the eu decodes and executes the instructions using the sixteen-fleck alu.

l the eu contains many registers, the following sixteen-flake yard eneral p urpose r egisters:

l ax - the accumulator

l bx - the base annals

fifty cx - the count register

l dx - the data register

l sp - the stack arrow

50 bp - the base pointer

fifty si - the source index register

l di - the destination annals

full general purpose registers

ax

fifty accumulator register

l preferred register to use in arithmetic, logic and information transfer instructions because information technology generates the shortest machine language code

l must exist used in multiplication and division operations

fifty must also be used in i/o operations

bx

fifty base register

l also serves as an accost register

50 used in array operations

cx

l count register

l used as a loop counter

fifty used in shift and rotate operations

dx

l data register

50 used in multiplication and division

l also used in i/o operations

tafe.al-solteany

segment registers in 8086

in that location are iv segment registers in the 8086 processor, cs , ds , es , and ss , likewise known as code segment , data segment , extra segment , and stack segment.

any time an address is generated by the processor, it is added to the

value of 1 of the segment registers. in order to generate the physical accost that accesses memory.

this gives an constructive accost range of xx $.25, or 1mb, just annotation that only 64kb is addressable through any segment register at 1 fourth dimension, unless you stop to alter the contents of that segment register.

lawmaking segment(cs)

in computing, a code segment, besides known every bit a text segment or simply every bit text, is a phrase used to refer to a portion of memory or of an object file that contains executable instructions. it has a fixed size and is unremarkably read-only.

cs - points at the segment containing the current programme. cs- is a sixteen-bit register containing address of 64 kb segment with processor instructions .cs annals cannot be inverse direct. the cs register is automatically updatingd. used for access to program code.

data segment

a information segment is one of the sections of a program in an object file or in retentiveness,

which contains the global variables and static variables that are initialized past the programmer. ds- is a sixteen-bit register containing accost of 64 kb segment with processor instructions .information technology has a fixed size, it is non read-only. (ds) register is used for access to data.

stack register

the stack annals contains the address of the last item pushed on the stack. the stack is a region of retentiveness used for temporary storage of pedagogy addresses and register values in a last-in-first-out. ss- is a 16-flake register containing address of 64 kb segment with processor instructions.

the stack is where the 8086 stores important machine state data, subroutine render addresses

extra segment

es- is a 16-chip annals containing address of 64 kb segment with processor instructions.

use this segment annals to access to segments when it is hard or incommunicable to modify the other segment registers.

presented by: ghaith faisal ali

pointer and index registers

? used to keep offset addresses.

? used in various forms of memory addressing.

? in the case of sp and bp the default reference to class a physical address is the stack

? the index registers (si & di) and the bx more often than not default to the data

segment register(ds).

• sp: stack arrow

– used with ss to access the stack segment

• bp: base pointer

– primarily used to access data on the stack

can exist used to admission information in other segments

• si: source index annals

– is required for some cord operations

– when cord operations are performed, the si register points to

retention locations in the data segment which is addressed by the ds

register. thus, si is associated with the ds in string operations.

• di: destination index annals

– is also required for some string operations.

– when cord operations are performed, the di annals points to

memory locations in the data segment which is addressed by the es

register. thus, di is associated with the es in string operations.

• the si and the di registers may also be used to access data stored in

arrays

memory segmentation

the full memory size is divided into segments of various sizes. a segment is

just an area in memory. the process of dividing retentivity this fashion is chosen segmentation.

in memory data is stored equally bytes, each byte has specific address. intel 8086 has twenty lines address coach. with twenty address lines, the memory that can exist addressed is bytes.

= 1,048,576 bytes (one mb).

8086 tin can access memory with address ranging from 00000 h to fffff h.

in 8086, memory has four different types of segments.

these are:

· code segment

· data segment

· stack segment

· extra segment

each of these segments is addressed by an address stored in corresponding segment register. these registers are 16 scrap in size, each register stores the base address (starting accost) of the corresponding segment. considering the segment registers cannot shop xx $.25, they only store the upper 16 bits. see figure (1).

figure(one) illustrate segment registers and memory

q.\

how is a xx-flake address obtained if there are only 16-scrap registers?

answer:

xx-bit address of byte is chosen concrete address, only information technology is specified as logical accost.

logical address is in the form of:

base accost : outset

offset is the displacement of the retentiveness location from the starting location of the segment.

example

permit the value of data segment annals (ds) is 2222 h.

to convert this 16-fleck address into 20-bit, the biu

1- appends 0h to the lsb of the address.

two- after appending the starting address of the data segment becomes 22220 h.

iii- if the data at any location has a logical address specified as:

2222 h : 0016 h

four- and then the number 0016 h is the first.

2222 h is the value of ds.

5- to calculate the effective address of the memory, biu uses the following

formula:

constructive accost = starting address of segment + offset.

to find the starting address of the segment, biu appends the contents of segment

annals with 0h. then, it adds offset to it. see figure(2)

therefore : ea = 22220 h

+ 0016 h

-

22236 h

figure(2) illustrate effective address

remarks:

v all offsets are limited to 16-scrap.

5 it means that the maximum size possible for segment is = 65,535 bytes(64 kb)

v the beginning of the first location inside the segment is 0000 h.

v the offset of the final location in the segment is ffff h.

see tale (1-i).

tabular array(one-1) illustrate beginning registers

question\

the contents of the following registers are:

cs = 1111 h

ds = 3333 h

ss = 2526 h

ip = 1232 h

sp = 1100 h

di = 0020 h

calculate the respective concrete address for the address bytes in cs, ds, ss.

solution\

1. cs = 1111 h

· the base of operations address of the lawmaking segment is 11110 h.

· effective address of retentivity is given by 11110h + 1232h = 12342h.

2. ds = 3333 h

· the base of operations address of the lawmaking segment is 33330 h.

· effective address of retentiveness is given by 33330h + 0020h = 33350h.

3. ss = 2526 h

· the base accost of the code segment is 25260 h.

· effective address of memory is given by 25260h + 1100h = 26350h.

What Value Would You Load Into The Segment Register To Access Physical Memory With Offset,

Source: https://it.uobabylon.edu.iq/lecture.aspx?fid=22&lcid=3119

Posted by: allenleareved.blogspot.com

0 Response to "What Value Would You Load Into The Segment Register To Access Physical Memory With Offset"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel