	page 60,132
TITLE Ryan Kightlinger - Lab 7 (Fibonacci Numbers) - EXE Simplified Segments 
;---------------------------------------------------------
	.MODEL  SMALL
	.STACK  64
	.DATA

number1   DW      01H		; defines 1st fibonacci number
number2   DW      01H		; defines 2nd fibonacci number
temp      DW      00H		; temp variable used to calculate newest fibonacci number
;---------------------------------------------------------
	.CODE
MAIN	PROC	FAR

        MOV    AX, @data        ; set address of data in datasegment
        MOV    DX, AX
        MOV    AX, 00H          ; initialize AX register to 0
        MOV    BX, 00H          ; initialize BX register to 0

        MOV    CX, CH           ; initialize CX counter to CH for 12 loops

FIBLABEL:

        MOV   AX, number1       ; send number1 to AX register
        ADD   AX, number2       ; add number2 to AX register
        MOV   temp, AX          ; move AX to temp

        MOV   BX, number2       ; make number2 the new number1
        MOV   number1, BX 

        MOV   BX, temp          ; make temp the new number2
        MOV   number2, BX        

        LOOP   FIBLABEL         ; Decrement CX, loop if nonzero

        MOV    AX,4c00H		; end processing
	INT    21H
MAIN    ENDP
        END MAIN

