Skip to content

Instantly share code, notes, and snippets.

@kp96
Created September 2, 2015 17:39
Show Gist options
  • Save kp96/910a3f4cbfb6e837d065 to your computer and use it in GitHub Desktop.
Save kp96/910a3f4cbfb6e837d065 to your computer and use it in GitHub Desktop.
alp program to find fibonacci sequence
MOV R1,#0AH
MOV R2,#00H
MOV A,#00H
MOV DPTR,#2000H
MOVX @DPTR, A
INC A
INC DPTR
MOVX @DPTR, A
DEC R1
DEC R1
INC DPTR
MOV A,#00H
MOV B,#01H
LOOP: ADD A,B // A = A + B
MOV R2,A // C = A + B
MOVX @DPTR, A
INC DPTR
MOV A,B// A = B
MOV B,R2// B = C
DJNZ R1,LOOP
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment