Assume that a binary number is stored in memory location 8301H.

Write 8085 Assembly Language Program to perform the conversion depending upon the value stored in memory location 8300H.
Code:
OPERATION	MEMORY
LOCATION (H)	DATA (H)	TYPE OF DATA
BINARY TO UNPACKED
BCD CONVERSION	8300	00	Decision data
	8301	F3	Binary number (Input data)
	8302		Unpacked BCD3  (Result 1)
	8303		Unpacked BCD2 (Result 2)
	8304		Unpacked BCD1 (Result 3)
BINARY      TO      GRAY
CODE CONVERSION	8300	FF	Decision data
	8301	F3	Binary number (Input data)
	8302		Gray code (Result)
Perform the above task by writing a main program and two subroutines.

Main program can be used to perform initialization, get the input data in accumulator, to call the subroutines depending upon the decision data and to store the results.
Subroutine 1 can be used to perform binary to BCD conversion.
Subroutine 2 can be used to perform binary to gray code conversion.

Last edited by shabbir; 22Jan2014 at 15:12.. Reason: Code blocks