8085 Programming : 8 BIT DECIMAL SUBSTRACTION



 8085 Programming




If 2nd no is greater than 1st no then the answer will in 2's complement

Manually strore 1st 8 bit no in the memory location C050

Manually store 2nd 8 bit no in the memory location C051

Result is stored in C052



  LXI H,C051

  MVI A,99

  SUB M

  INR A

  DCX H

  ADD M

  DAA

  STA C052

  HLT

 EXAMPLE-> 99-48=51

 STORE-> C050=99,C051=48



OUTPUT:

C052=51





Comments

Popular posts from this blog

Write a Program to Add two 3x3 Matrix using C

C program for Unit Conversion

Write a Program to Add two 5x5 Matrix using C