;
; This program calculates Fibonacci numbers and stores them in memory.
;
	ORG     0H
	MOVW    #200H,R2	; Load the address of the first number to R2
	MOVB	0(R2),R0	; Load first Fibonacci number to R0
	ADDQW	#1,R2		; Increment address pointer
	MOVB	0(R2),R1	; Load second Fibonacci number to R1
	ADDQW	#1,R2		; Increment address pointer

LOOP:
	ADDB	R1,R0		; R0 <-- R0 + R1
	MOVB	R0,0(R2)	; store the new number to memory
	ADDQW	#1,R2		; Increment address pointer
	ADDB	R0,R1		; R1 <-- R1 + R0
	MOVB    R1,0(R2)	; Store the new number to memory
	ADDQW	#1,R2		; Increment address pointer
	BRA	LOOP		; Repeat process

	ORG     200H
	DB      01H,01H		; First two Fibonacci numbers


The assembled code (in HEX) is as follows :

95 A0 02 00
14 50 00
8D 10
54 50 00
8D 10
00 08
94 02 00
8D 10
40 00
94 0A 00
8D 10
EA 72
