Discuss Different Address or Ssegment Rregisters?

Discuss different address or segment registers?

Segment is block of memory. Address or segment registers are used to store the address of memory blocks of the instruction being executed. These are four segment registers. These are CS, DS, ES and SS. The size of each register is two bytes. These registers are used with IP register or index registers DI and SI. Different segment registers are as follows:

1. Code segment (CS): It is used to store the base location of all executable instructions in the program. It is used with IP register to fetch program instruction from memory.

2. Data Segment (DS): It is used as the default base location for memory variables. It is used with DI or SI registers to refer to the data in memory.

3. Extra Segment (ES): It is used as an additional base location for memory variables.

4. Stack Segment (SS): it is contains the base location of the current program stack.

 What is instruction set? Explain different types of operations performed by the computer.

Instructions Set

A set of all instructions that a CPU can perform is called instruction set. Different types of CPU can execute different instructions sets. Normally, a modern CPU cans executer 80 to 120 instructions.

Types of Instructions

The instruction set consists of the following types of instructions:

1. Data transfer Instructions

2. Arithmetic and logical instruction

3. I/O instructions

4. Control Transfer Instructions

1. Data Transfer Instructions

The instructions used to transfer data from one component to another component during program execution are called data transfer instructions. All CPUs provide different instructions to transfer data. A programmer can use these instructions to move data in CPU.

These instructions can also copy data from CPU to the main memory.

2. Arithmetic and Logical Instructions

The instructions used to perform arithmetic operations are called arithmetic instructions. Different arithmetic operations are addition, subtraction, multiplication and division. These instructions are executed by the arithmetic & logic unit of CPU.

The instructions used to perform logical operations are called logical instructions. A logical operation in the comparison of two data values. Possible comparisons are as follows:

1. Greater than, 2. Equal to, 3. Less than

These instructions are also executed by the Arithmetic & Logical unit of CPU.

3. I/O instructions

Every CPU provides the operations of reading data from peripheral devices and writing data to peripheral devices. These devices include keyboard, mouse and disks etc. a programmer can use I/O operations by issuing different input and output instructions.

4. Control Transfer Instructions

The instructions used to change the sequence of instructions of a program are called control transfer instructions. These instructions transfer the execution control to a certain part of program instead of next instruction. Some examples of these operations are JUMP and JUMPZ (JUMP if zero) etc.

What is instruction format? Explain various instructions code formats.

An instruction is a statement the tells the computers to do something. The way an instruction is given is called instruction format.

A computer has a variety formats. The control unit of CPU is responsible to interpret the instruction code. The control unit also provides the necessary control function required to proocess the instruction. A simple instruction format consists of 16 bits.

There are two parts of instruction code format:

1. Operand Code

2. Address of Operand

1. Operand Code

He operand code specifies the operation to be performed by the computer. Such as ADD, Sub and MOV etc. It takes 4 bits. An operand can be a value or register number on which the operation is performed.

general instruction format

Figure: general instruction format

2. Address of operand

The address of operand refers to a location in main memory where the value is stored.

Types of instruction Formats

Different types of instructions formats are as follows:

1. zero-Address Instruction Format

In zero-address instruction format, an address field is absent in the instruction. A stack-organized computer does not use an address field for the instructions like ADD and MUL. However, the instructions such as PUSH and POP require an address field to specify the operand that communicates with the stack.

2. One- address instruction format

This format uses only one address field. It uses one accumulator register (AC) for all data manipulation. A second register is required for multiplication and division.

3. Two-Address Instruction Format

This format uses three address fields. The computer can use each address field to specify register or memory operand. Its advantage is that the result of arithmetic expressions is short. The disadvantage is that the binary-coded instructions require many bits to specify three addresses.

4. three-address instruction format

This format uses three address fields. The computer can use each address field to specify register or memory operand. Its advantage is that the result of arithmetic expressions is short. The disadvantage is that the binary-coded instructions require many bits to specify three addresses.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>