Computer Science, asked by Sahkfd4626, 1 year ago

Write a program using 8085 and verify for 16 bit subtraction

Answers

Answered by Anonymous
0
☞Key in the opcodes from the address specified.

☞Enter data that is needed for execution at 8650 and 8651.

☞Execute the program and check for results at 8652.

☞Try changing data and check for results each time.

EXAMPLE

Let the data to be subtracted be 24 from 49.
DATA: (8650) = 49
(8651) = 24
RESULT: (8652) = 25

RESULT

Thus the Subtraction of two 8 bit numbers is stored in the resultant memory

Answered by Anonymous
1

Starting address of program: 2000

Input memory location: 2050, 2051, 2052, 2053

Output memory location: 2054, 2055

Example –

INPUT: (2050H) = 19H (2051H) = 6AH (2052H) = 15H (2053H) = 5CH OUTPUT: (2054H) = 04H (2055H) = OEH

RESULT:

  • Hence we have subtracted two 16 bit numbers.

Algorithm –

  • Get the LSB in L register and MSB in H register of 16 Bit number.

  • Exchange the content of HL register with DE register.

  • Again Get the LSB in L register and MSB in H register of 16 Bit number.

  • Subtract the content of L register from the content of E register.

  • Subtract the content of H register from the content of D register and borrow from previous step.

  • Store the result in memory location.

Similar questions