Data Transfer and Manipulation Submitted by Pushkar Raj 3CSE-2E-Y Guided by Mr.Paurush Bhulania 1 Data Transfer and Manipulation Most computer instructions can be classified into three categories: (a) Data transfer instructions (b) Data manipulation instructions (c) Program control instructions 2 Data Transfer Instruction Data transfer instructions cause transfer of data from one location to another without changing the binary information content. The most common transfer are between memory and processor registers, between processor registers and input or output, and between the processor registers themselves. It provide user flexibility to carry out various computational tasks. 3 Data Transfer Instructions Load:transfer from memory to a processor register, usually an AC. Store:transfer from a processor register into memory. Move:transfer from one register to another register. Exchange:swap information between two registers. Input/Output:transfer data among processor resisters. Push/Pop:transfer data between a memory stack and P.E. 4 Data Manipulation Instructions Data manipulation instructions are those that perform arithmetic, logic, and shift operations. • The data manipulation instructions in a typical computer are usually divided into three basic types: 1. Arithmetic instructions 2. Logical and bit manipulation instructions 3. Shift instructions 5 Arithmetic Instructions • The four basic arithmetic operationaddition,subtraction, multiplication and division. 6 Logical and Bit Manipulation Instructions • • Logical instructions perform binary operations on strings of bits stored in registers. They are useful for manipulating individual bits or a group of bits that represent binary coded information. 7 Shift Instructions • Instruction to shift the content of an operand • Shift are operations in which the bits of a word are moved to the left or right. 8 Program control • Program control instructions provide decision-making capabilities and change the path taken by the program when executed in the computer. 9 Status Bit Conditions • It is convenient to supplement the ALU circuit in the CPU with a status register where status bit conditions can be stored for further analysis. • Status bits are also called condition-code bits or flag bits. • The four status bits are symbolized by C, S, Z, and V. • The bits are set or cleared as a result of an operation perform in the ALU. 10 4-bit Status register • Bit C(carry): set to 1 if the end carry C8 is 1 • Bit S(sign): set to 1 if F7 is 1 • Bit Z(zero): set to 1 if the output of the ALU contains all 0’s • Bit V(overflow): set to 1 if the exclusive-OR of the last two carries(C8 and C7) is equal to 1. 11 Conditional Branch Instruction 12 Program Interrupts • Transfer program control from a currently running program to another services program as a result of an external or internal generated request. • Control returns to the original program after the services program is executed. Type of Interrupts: 1. External interrupts 2. Internal interrupts 3. Software interrupts 13 External Interrupts External interrupts come from input output (I/0) devices. Example: • From a timing device, • From a circuit monitoring the power supply • From any other external source. 14 Internal Interrupts Internal interrupts arise from illegal or erroneous use of an instruction or data. Internal interrupts are also called traps. Interrupts caused by internal error conditions. Example: • Register overflow • Attempt to divide by zero, • An invalid operation code, • Stack overflow etc. 15 Software Interrupts External and internal interrupts are initiated from signals that occur in the hardware of the CPU. A software interrupt is initiated by executing an instruction. Software interrupt is a special call instruction that behaves like an interrupt rather than a subroutine call. It can be used by the programmer to initiate an interrupt procedure at any desired point in the program. 16 The End Thank you 17