
*******************************************************************
*                            					  *
* This is a demo for an 8085 microprocessor.                      *
* The program calculates Fibonacci numbers. The first two numbers *
* '01' are read from memory by the 8085 and it then begins with   *
* the calculations. As it calculates the numbers, they are stored *
* serially in the memory for later inspection.....                *
*                                                                 *
* The demo uses a reference element for the 8085. It is modelled  * 
* as a dynamic device.....                                        *
*                                                                 *
*******************************************************************

 START:	 LXI   D,200H	 ;Load reg pair DE with 200H. Reg pair DE is 
		         ;the pointer to memory where the #s are stored.

	 LDAX  D         ;Move into Accumulator the first number from mem
			 ;pointed to by reg pair DE.

         MOV   B,A 	 ;Move contents of reg A to reg B.
	
         INX   D         ;Increment the memory pointer.

         LDAX  D	 ;Load into accum(reg A) the contents of the 
	 		 ;second memory location.

	 MOV   C,A       ;Move contents of reg A to reg C.

	 INX   D         ;Increment the memory pointer.


 REPEAT: ADD   B         ;Add the present two numbers in reg A and reg B to 
			 ;generate the next number in reg A.

	 MOV   B,C	 ;Move contents of reg C to reg B.

         MOV   C,A       ;Move contents of reg A to reg C.

	 STAX  D         ;Store the contents of reg A to memory.

	 INX   D         ;Increment the memory pointer.

	 JMP   REPEAT    ;Jump back to REPEAT and loop indefinitely. 

	 END.
