8051 microcontroller programming:Tutorial-Generating sequences-(0*1,1*2,2*3,......(n-1)*n)
Generating a particular is some of the common needs for a programmer.
Let us see how a sequence can be generated.
Consider the sequence-0*1,1*2,2*3,3*4,..................,(n-1)*n, where is the input.
PROGRAM:
Let us see how a sequence can be generated.
Consider the sequence-0*1,1*2,2*3,3*4,..................,(n-1)*n, where is the input.
PROGRAM:
ORG 00H MOV DPTR,#2000H MOVX A,@DPTR MOV R0,A MOV A,#00H MOV R1,A LOOP: MOV A,R1 MOV B,A INC A MOV R1,A MUL AB INC DPTR MOVX @DPTR,A DJNZ R0,LOOP END
Sooper cool
ReplyDeleteVery nice
ReplyDeleteVery nice
ReplyDelete