Data Transfer & Manipulation.pptx

488 views 17 slides Apr 06, 2023
Slide 1
Slide 1 of 17
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17

About This Presentation

SHIFT INSTRUCTION, PROGRAM CONTROL, PROGRAM INTERRUPT


Slide Content

Data Transfer and Manipulation ARCHANA R, ASSISTANT PROFESSOR IN DEPARTMENT OF CS SACWC.

Data Transfer and Manipulation Most computer instructions can be classified into three categories: Data transfer, Data manipulation, Program control instructions

Data Transfer Instruction Data transfer instructions move data from one place in the computer to another without changing the data content The most common transfers are between memory and processor registers,between processor registers and input or output,and between the processor registers themselves.

NAME Mnemonic Load LD Store ST Move MOV E x cha n ge XC H Input IN O u t p u t O U T Push PUSH pop POP Typical Data Transfer Instruction : » Load : transfer from memory to a processor register, usually an AC ( memory read) » Store : transfer from a processor register into memory ( memory write) » Move : transfer from one register to another register » Exchange : swap information between two registers or a register and a memory word » Input/Output : transfer data among processor registers and input/output device » Push/Pop : transfer data between processor registers and a memory stack

Data Manipulation Instruction Data Manipulation Instructions perform operations on data and provide the computational capabilities for the computer. It is divided into three basic types: Arithmetic, Logical and bit manipulation, Shift Instruction

Arithmetic Insructions NAME Mnemonic Increment INC Decrement DEC Add ADD S u b t ra c t S UB Multiply MUL D ivi d e D I V Add with carry ADDC S u b t ra c t wi t h S UBB borrow Negate (2’s NEG complement)

Logical and bit manipulation Insructions NAME Mnemonic Clear CLR Complement COM AND AND O R O R Exclusive-or XOR Cl e a r c ar r y C L R C Set carry SETC c o m p l e m ent c a rry CO MC Enable interrupt EI D i s a b l e i n t er r u p t D I

Shift Instructions N A ME M n emo n ic Logical shift right SHR Logical shift left SHL Arithmetic shift SHRA right Arithmetic shift SHLA left Rotate right ROR Rotate left ROL Ro t a t e r i g h t R O RC through carry Rotate left ROLC through carry

Program control Program control instructions specify conditions for altering the content of the program counter , while data transfer and manipulation instructions specify condtions for data-processing operations. NAME Mnemonic Branch BR Jump JMP Skip SKP C a l l CA LL Return RET Compare(by subtraction) CMP Test(by ANDing) TST

Status Bit Conditions It is convinent to supplement the ALU circuit in the CPU with a status register where status bit condition can be stored for further analysis. Status bits are also called condition code bit or flag bit. The four status bits are symbolized by C,S,Z and V. The bits are set or cleared as a result of an operation performed in the ALU

4-bit status register

Conditional Branch Instructions

Subroutine Call and Return It is a self-contained sequence of instructions that performs a given computational task. During the execution of a program,a subroutine may call when it is called, a branch is executed to the beginning of the subroutine to start executing its set of instructions. After the subroutine has been executed,a branch is made back to the main program.

A subroutine call is implemented with the following microoperations: CALL: SP← SP-1 : Decrement stack point M[SP] ←PC : Push content of PC onto the stack PC← Effective Address : Transfer control to the subroutine RETURN: PC ← M[SP] : Pop stack and transfer to PC SP ← SP+1 : Increment stack pointer

Program Interrupt » Transfer program control from a currently running program to another service program as a result of an external or internal generated request » Control returns to the original program after the service program is executed

Types of Interrupts External Interrupts » come from I/O device, from a timing device, from a circuit monitoring the power supply, or from any other external source Internal Interrupts or TRAP » caused by register overflow, attempt to divide by zero, an invalid operation code, stack overflow, and protection violation Software Interrupts » initiated by executing an instruction ( INT or RST) » used by the programmer to initiate an interrupt procedure at any desired point in the program

THANK YOU