You are on page 1of 14

A Presentation On Instruction format & Data transfer and manipulation

UNDER THE GUIDENCE OF Er. Santosh Singh (Computer Science & Engineering) Kamla Nehru Institute of Engineering and Technology Sultanpur SESSION:2011-2012
SUBMITTED BY PREETI GUPTA M.tech(1st sem) 1110210

Instruction format
Each computer have instruction code and it is interpreted by control unit by CPU.Instruction format is represented as a rectangular box in form of bits & these bits are divided into groups called fields. Fields of Instruction format1. Opcode: the operation to be performed 2. Address field: address of operand 3. Mode field: mode of operand either direct or indirect

ADD

457

ADD

300

300

1350

457

Operand

1350

Operand

CPU Organization

Single accumulator: All operation is performed in accumulator. Ex. ADD X ACAC+M[X] General Register type: Ex. ADD R1 R2 R3 R1R2+R3 Stack Organization: Ex. PUSH X

Example. (A+B)*(C+D)

Three address field ADD R1 A B R1<- M[A]+M[B] ADD R2 C D R2<-M[C]+M[D] MUL X R1 R2 M[X]<-R1*R2

Two address field


MOV ADD MOV ADD MUL MOV R1 A R1 B R2 C R2 D R1 R2 X R1 R1<-M[A] R1<-R1+M[B] R2<-M[C] R2<-R2+M[D] R1<-R1*R2 M[X]<-R1

Zero address field


PUSH PUSH ADD PUSH PUSH ADD MUL POP TOS<-A TOS<-B TOS<-A+B C TOS<-C D TOS<-D TOS<-(C+D) TOS<-(C+D)*(A+B) X M[X]<-TOS A B

Data transfer and Manipulation Computer instructions are classified into three categories: Data transfer instruction-It transfer data from one place to another. Data manipulation- It are those that perform arithmatic,logic and shift operation. Program Control-It decide & change the path taken by program when execute.

Data transfer instruction

Name
Load Store Move Exchange Input Output Push Pop

Mnemonic
LD ST MOV XCH IN OUT PUSH POP

Name

Mnemonic

Direct address Indirect address Relative address Immediate operand Index addressing Register address Register indirect Auto increment

LD ADR LD@ADR LD$ADR LD#NBR LDADR(X) LD R1 LD(R1) LD(R1)

Data Manipulation Instruction


1.Arithmetic Instruction
Name Increment Decrement Add Subtract Multiply Divide Add with Carry Subtract with borrow Negate Mnemonic INC DEC ADD SUB MUL DIV ADDC SUBB NEG

10

The mnemonic for three address instruction that specify data type.
ADDI Add two binary integer number ADDF Add two floating point number ADD D Add two decimal number in BCD

11

2.Logical & bit operation


Name Clear Complement AND OR Exclusive-OR Clear carry Set carry Complement carry Enable interrupt Disable interrupt Mnemonic CLR COM AND OR XOR CLRC SETC COMC EI DI

12

3.Shift Instruction Name Logical shift right Logical shift left Arithmetic shift right Arithmetic shift left Rotate right Rotate left Rotate right through carry Rotate left through carry Mnemonic SHR SHL SHRA SHLA ROR ROL RORC ROLC
13

14

You might also like