;sum of set of numbers ;external memory ORG 0H START: MOV R0,#10  ;No of bytes MOV R1,#00  ;R1=SUM=0 MOV DPTR,#9000H  ;DPTR=9000 LOOP:      MOVX A,@DPTR ADD A,R1  ;Sum=sum+n[i] MOV R1,A INC DPTR DJNZ R0,LOOP SJMP $ END 
Related topics:
8051 Program - sum of a set of numbers | 8051 Program - average of a set of numbers | 8051 Program - arithmetic operation 8bit | 8051 Program - addition 8bit | 8051 Program - subtraction 8bit | 8051 Program - move block of data external memory | 8051 Program - ram to ram | 8051 Program - memory subroutines | 8051 Program - math subroutines | 8051 Program - conversion subroutines
List of topics: 8051
 
No comments:
Post a Comment