Date post: | 04-Apr-2018 |
Category: |
Documents |
Upload: | kiran-kishore |
View: | 214 times |
Download: | 0 times |
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 1/20
Data Transfer and Manipulation
By:-
Kiran Kishore Valathati
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 2/20
Data Transfer and
Manipulation
Most computer instructions can be classified
into three categories:1) Data transfer,
2) Data manipulation,
3) Program control instructions
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 3/20
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.
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 4/20
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 registerand a memory word
» Input/Output : transfer data among processor registers andinput/output device
» Push/Pop : transfer data between processor registers and a
memory stack
NAME Mnemonic
Load LD
Store ST
Move MOV
Exchange XCH
Input IN
Output OUT
Push PUSH
pop POP
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 5/20
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:
1) Arithmetic,
2) Logical and bit manipulation,
3) Shift Instruction
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 6/20
Arithmetic Insructions
• The four basic
arithmetic operations
are
addition,subtraction,
multiplication,and
division.
NAME Mnemonic Increment INC
Decrement DEC
Add ADD
Subtract SUBMultiply MUL
Divide DIV
Add with carry ADDC
Subtract with
borrow
SUBB
Negate (2’s
complement)
NEG
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 7/20
Logical and bit manipulation Insructions
• Logical instructions
perform binary
operations on strings of
bits stored in registers.• They are useful for
manipulating indvidual
bits or a group of bits
that represent binary-coded information.
NAME Mnemonic
Clear CLR
Complement COM
AND AND
OR OR
Exclusive-or XOR
Clear carry CLRC
Set carry SETC
complement carry COMC
Enable interrupt EI
Disable interrupt DI
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 8/20
Shift Instructions
• Instuctions to shift the
content of an operand
• Shifts are operations in
which the bits of a wordare moved to the left or
right.
NAME Mnemonic
Logical shift right SHR
Logical shift left SHL
Arithmetic shiftright
SHRA
Arithmetic shift
left
SHLA
Rotate right ROR
Rotate left ROL
Rotate right
through carry
RORC
Rotate left
through carry
ROLC
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 9/20
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
Call CALL
Return RET
Compare(by subtraction) CMP
Test(by ANDing) TST
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 10/20
Status Bit Conditions
• It is convinent to supplement the ALU circuitin the CPU with a status register where statusbit 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,Zand V.
• The bits are set or cleared as a result of anoperation performed in the ALU
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 11/20
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) isequal to 1
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 12/20
Conditional Branch Instructions :
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 13/20
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 ismade back to the main program.
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 14/20
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
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 15/20
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
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 16/20
Types of Interrupts
1) External Interrupts
» come from I/O device, from a timing device, from a circuit
monitoring the power supply, or from any other externalsource
2) Internal Interrupts or TRAP» caused by register overflow, attempt to divide by zero,
an invalid operation code, stack overflow, and protectionviolation
3) Software Interrupts
» initiated by executing an instruction (INT or RST)
» used by the programmer to initiate an interruptprocedure at any desired point in the program
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 17/20
What is RISC?
• RISC? RISC, or Reduced Instruction Set Computer . is a type of microprocessor architecturethat utilizes a small, highly-optimized set of instructions, rather than a morespecialized set of instructions often found in other types of architectures.
• History The first RISC projects came from IBM, Stanford, and UC-Berkeley in the late 70sand early 80s. The IBM 801, Stanford MIPS, and Berkeley RISC 1 and 2 were alldesigned with a similar philosophy which has become known as RISC. Certaindesign features have been characteristic of most RISC processors: – one cycle execution time: RISC processors have a CPI (clock per instruction) of one cycle.
This is due to the optimization of each instruction on the CPU and a technique calledPIPELINING
– pipelining: a techique that allows for simultaneous execution of parts, or stages, of instructions to more efficiently process instructions;
– large number of registers: the RISC design philosophy generally incorporates a largernumber of registers to prevent in large amounts of interactions with memory
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 18/20
CHARACTERISTICS OF RISC
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 19/20
What is CISC?
• CISC is an acronym for Complex Instruction Set Computer and are chips that areeasy to program and which make efficient use of memory. Since the earliestmachines were programmed in assembly language and memory was slow andexpensive, the CISC philosophy made sense, and was commonly implemented insuch large computers as the PDP-11 and the DECsystem 10 and 20 machines.
• Most common microprocessor designs such as the Intel 80x86 and Motorola 68K
series followed the CISC philosophy.
• But recent changes in software and hardware technology have forced a re-examination of CISC and many modern CISC processors are hybrids, implementingmany RISC principles.
• CISC was developed to make compiler development simpler. It shifts most of theburden of generating machine instructions to the processor. For example, instead
of having to make a compiler write long machine instructions to calculate asquare-root, a CISC processor would have a built-in ability to do this.
7/31/2019 Data TF,Manipulation,Program Control
http://slidepdf.com/reader/full/data-tfmanipulationprogram-control 20/20