Module 3 : Programmable Logic Devices (PLDs)

Lecture 2 : Introduction to microprocessor programming

4. Programming in 8085

As mentioned in above section, a simple and very effective substitution to binary codes could be use of standard English words to complete any task. For example addition of two numbers can be represented by ADD. Such codes are referred as mnemonic codes and that language is called assembly language. Most of the early processers including 8085, are programmed using mnemonics. However, assembly language codes should be converted into binary one so that microprocessor can identify the instructions given to it. This operation is done by Assembler. In assembly language, instructions are composed of two segments which are as follows:

  1. Operation (Op) Code: It depends on which operation is to be performed. For example for OR operation, we have Op Code “OR”.

  2. Operands: Operand is the object on which the required operation is to be done. Generally operations are done on data stored in registers.

4.1 Classification of Instructions:

4.1.1 Data Transfer

  1. Load: It reads content from specified memory location and copies it to specified register location in CPU.

  2. Store: It copies content of a specified register into specified memory location.

4.1.2 Arithmetic:

  1. Add: It adds contents of a specified memory location to the data in some register.

  2. Decrement: It subtracts 1 from contents of specified location.

  3. Compare: It tells whether contents of a register are greater than, less than or same as content of specified memory location.

4.1.3 Logical:

  1. AND: Instruction carries out Logical AND operation with the contents of specified memory location and data in some register. Numbers are ANDed bit by bit.

  2. OR: Instruction carries out Logical OR operation with the contents of specified memory location and data in some register. Numbers are ORed bit by bit.

  3. Logical Shift: Logical shift instruction involves moving a pattern of bits in the register one place to left or right by moving a zero in the end of number.

4.1.4 Program Control:

  1. Jump: This instruction changes the sequence in which program steps are carried out. Normally program counter causes the program to be carried out sequentially in strict numerical sequence. However, JUMP causes program counter to some other specified location in the program.

  2. Branch: This is a conditional instruction which might ‘branch' if ‘zero' results or ‘branch' if ‘plus' results of an operation. Branch also followed if right conditions occur in the decision making process.

  3. Halt: This instruction stops all further microprocessor activity.