Microprocessor instructions

767 views 22 slides Aug 15, 2020
Slide 1
Slide 1 of 22
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
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22

About This Presentation

This ppt explains about Microprocessor instructions


Slide Content

MICROPROCESSOR INSTRUCTIONS Dr.R.Hepzi Pramila Devamani , Assistant Professor of Physics, V.V.Vanniaperumal College for Women, Virudhunagar

INTRODUCTION An instruction is a command issued in the form of a bit pattern to perform a given task on a specified data. Each instruction basically consists of two parts, the first part is called OPCODE and the second as OPERAND. The operand either provides the data or specifies data to be operated on. The operand can be specified in a number of ways, it includes:

INTRODUCTION 8 – bit /16 – bit internal general purpose register A memory location 8 – bit port address/16 – bit memory address Implicit operand: the operand is not specified, instead it is assumed in register. A programmer can easily write a program in alphanumeric symbols instead of zeros and ones. Meaningful and easily rememberable symbols are chosen for the purpose, examples are: ADD for addition, SUB for subtraction, CMP for comparison etc. Such symbols are called MNEMONICS.

INTRODUCTION A program written in mnemonics is known as assembly language program. The writing of a program in assembly language is much easier and faster as compared to the writing of a program in machine language, both assembly language and machine language are microprocessor-specific. A microprocessor-specific language is known as a low-level language. The distinguishing features of an assembly language is that corresponding to one mnemonic, there is only one machine code. On the other hand, corresponding to one statement of a high-level language, there is a number of machine codes.

INSTRUCTION FORMAT (Instruction word size) An instruction is a command to the microprocessor to perform a given task on specified data.The 8085 instruction set is classified into the following three group according to word size or byte size: 1-byte instructions 2-byte instructions 3-byte instructions In the 8085, ‘byte’ and ‘word’ are synonymous because it is an 8-bit microprocessor. However, instructions are commonly referred to in terms of byte rather than words. In all instructions the first byte is always the opcode , while remaining are operands.

ONE – BYTE INSTRUCTIONS In a 1 –byte instruction, there is only one Hex code, known as a Opcode or machine code. Such type instructions include the opcode and operand in the same byte. For example: These instructions are one-byte instructions having only one hex code each, known as opcode , performing three different tasks. In the first instructions both operand registers are specified. In the second instruction, the operand B is specified and the other operand accumulator is assumed. Similarly, in the third instructiion , the accumulator is assumed to be the implicit operand. These instrucions require one memory location each, stored in 8 – bit binary format in memory.

ONE – BYTE INSTRUCTIONS

TWO – BYTE INSTRUCTIONS In a 2 – byte instruction, the first byte specifies the operation code ( opcode ) and the second byte specifies the operand. For example: These instructions would require two memory locations each to store the hex code. The data bytes 45H are taken arbitrarily as examples.

TWO – BYTE INSTRUCTIONS

Three – bytes Instructions In a 3 – bytes instruction, the first byte specified the opcode and the rest – two bytes specifies the 16 – bit address. Note the second byte is the low-order address and the third byte is the high-order address. For example: These instructions would rquire three memory location each to store the hex codes. The 16-bit address F050 and F070H are taken arbitrarity as example:

Three – bytes Instructions

OPCODE FORMAT The microprocessor 8085 has has 8-bit opcode . To understand, how a opcode is designed/ formated in microprocessor. We need to specify all operation codes ( opcode ) in binary format and 8-bits are divided in various groups. The opcode is unique for each instruction and contains the information about operation register to be used, memory to be used, etc. The microprocessor 8085 identifies, all operation, registers and status flags with a specific code, known as opcode . For example, all internal registers are identified as follows: There is different code for each operation. Some of the operation codes are identified as follows:

OPCODE FORMAT

OPCODE FORMAT

OPCODE FORMAT

DATA FORMAT The 8085 is an 8-bit microprocessor and it can process only binary numbers. However, the real world operates in decimal number and languages of alphabets and characters. Therefore, it is needed to code binary number into different media. In 8-bit microprocessor system, commonly used codes and data formats are ASCII,BCD,HC,Signed integer and unsigned integer. They are explained as follows:

ASCII CODE The ASCII stands for American Standard Code for Information Interchange: it is pronounced as “ask- ee ”. It is a 7-bit alphanumeric code that represents decimal numbers, English alphabets and nonprintable characters such as carriage return. The ASCII code is widely used in small computers, peripherals, instruments and communication devices. Extended ASCII is an 8-bit code. The additional number (beyond 7-bit ASCIIcode ) represents graphical characters.

ASCII CODE

BCD Code The term BCD stands for binary-coded decimal, it is used for decimal numbers (0 to 9 digit), are represented by four binary bits (from 0000 to 1001). The remaining numbers, 1010 (A) to 1111 (F), are considered invalid. An 8-bit register in the 8085 MP can accommodate two BCD numbers.

Hex code (HC) Hex code is widely used with computers and other digital systems. The base of hex code is 16. the digit from 0 to 9 are same as those of the decimal numbers. In this code 10 is represented by A, 11by B, 12 by C, 13 by D, 14 by E and 15 by F. The decimal number 16 is represented by 10H, 17 by 11H, 18 by 12H, 32 by 20H, 33 by 21H and so on. An 8-bit register in the 8085 MP (microprocessor) can accommodate two hex code numbers.

Signed Integer A signed integer is either a positive number or a negative number. In an 8-bit processor, the most significant digit, D7 is used for the sign, 0 represents the positive sign and 1 represents the negative sign. Therefore, the largest positive integer that can be processed by the 8085 is 0111 1111 (7FH): the remaining hex numbers,80H to FFH are considered as negative numbers. However, all negative numbers in 8085 microprocessor are represented in 2’s compliment format.

Unsigned Integer An integer without a sign can be represented by all the 8-bits in a microprocessor register. Therefore, the largest number that can be processed at one time is FFH.