New York, NY IMG HI 58° LO 56° Home About Contact
IMG-LOGO
Home Electrical and Electronics Microprocessor & Interfacing Write an assembly language program to perform different arithmetic and logical operations on 8 bit and 16 bit operations.
Microprocessor & Interfacing Lab Experiments

Write an assembly language program to perform different arithmetic and logical operations on 8 bit and 16 bit operations.



Aim

Write an assembly language program to perform different arithmetic and logical operations on 8 bit and 16 bit operations.

Apparatus:Dyna 8085 microprocessor kit.

Program:

(a) Using Immediate Data (8 Bit):

Observations And Calculations : Law of Triangle of Forces

Address Opcode Mnemonic Operand Comments
C000 3E Data1 MVI A, Data1 Get first byte in the Accumulator
C002 06 Data2 MVI B, Data2 Get Second byte in Register B
C004 88 ADD B Addition of Data1 (A) + Data2 (B). Result is saved in accumulator A.
C008 76 HLT (RST1) Halt the program

  1. Press Space and Enter
  2. For results check the contents of the register A as:
  3. Press R as DYNA85>R.

    Example

    Data 1 Data 2 Result
    A = 2 B = 3 A = 5(Accumulator)

    (b) Program to add two 8 bit numbers using data stored in memory:

    Algorithm:

    1. Save the memory location of first number (i.e. C0B1) in HL register pair.
    2. Move first number/data into accumulator
    3. Add the second data with accumulator
    4. Store the result in memory location C0B3H.
    5. Store the carry in memory location C0B4H.
    6. Address Opcode Lable Mnemonic Operand Comments
      C000 21,B1,C0 LXI H, C0B1 H Get address of 1st number in H-L pair
      C003 7E Mov A, M Shift 1st no. in accumulator
      C004 23 INX H Increment content of H-L Pair to point to 2nd number
      MOV B, M Move 2nd no into Reg. B
      C005 86 ADD B 1 stno. + 2 nd no., result is stored in accumulator
      C006 23 INX H Increment
      C007 77 MOV M, A Move result at address C0B3 H
      C00E 23 INX H Move to next location
      C00F 00 36 MVI M, 00H Store 0 if carry is not generated
      C010 JNC Label1 (C014)
      C012 01 36 MVI M, 01H Store 1 as carry
      C014 76 Label1: HLT RST1 Halt

      Data given at specified memory locations:

      Address Data Comments Example
      C0B1 Data1 1stno. to be added 5
      C0B2 Data2 2ndno. to be added 2
      C0B3 Result Data1 + Data2 3
      C0B3 Carry Carry is stored as either 0 or 1 0

      Viva Questions:

      1. Name the important CPU registers in the 8085 microprocessor?
      2. Which are the addressing modes of 8085?
      3. What will be the status of carry and zero flags when instruction SUB A is executed?
      4. What is the use of ALE pin of 8085?
      5. What is Clock Speed ?











      Subscribe

      Get all latest content delivered to your email a few times a month.