8085 Microprocessor

9 Instruction Set Contd. With sample prog.

5). Stack,I/O and Machine control instructions:

  1. N port-address. (Input to accumulator from I/O port) [A] <-- [Port]
  2. OUT port-address (Output from accumulator to I/O port) [Port] <-- [A]
  3. PUSH rp (Push the content of register pair to stack)
  4. PUSH PSW (PUSH Processor Status Word)
  5. POP rp (Pop the content of register pair, which was saved, from the stack)
  6. POP PSW (Pop Processor Status Word)
  7. HLT (Halt)
  8. XTHL (Exchange stack-top with H-L)
  9. SPHL (Move the contents of H-L pair to stack pointer)
  10. EI (Enable Interrupts)
  11. DI (Disable Interrupts)
  12. SIM (Set Interrupt Masks)
  13. RIM (Read Interrupt Masks)
  14. NOP (No Operation).

Sample programs of instruction sets:

1).program for adding two 8 bit numbers.

 // Load accumulator from memory address

        // Move the content from accumulator to B

     //  Load accumulator from memory address 1001H   

           // Add the content of B to accumulator and store the result in accumulator

     // Store the content of accumulator in memory location 1002H

                             // Halt

           

 

 

 

            Another assembly language instruction sequence to solve the same problem.

 

              // Load lower order byte of address to register

            // Load higher order byte of address to register

            // Move the contents of memory location addressed by pair to

            //  Load the accumulator from memory location

              // Add the content of to accumulator

            // Store the content of accumulator to memory location

               // Halt.

 

 1).program for Multiplying two 8 bit numbers.

 

            MVI A,00  // Load immediate data into accumulator.

            MVI B,02//  Load immediate data into register B.

            MVI C,04// Load immediate data into register C.

LOOP:            ADD B  // Add the content of to accumulator.

            DCR C // Decrement the content of register C by 1.

JNZ  LOOP

            STA 1051H// Store the content of accumulator to memory location 1051H

            HLT    // Halt.