; FOR INTERNAL MEMORY
MOV R0, #30H ; STORE INTERNAL MEMORY ADDRESS IN RO
MOV A, #00H ; CLEAR ACCUMULATOR
MOV R7, #07H ; COUNTER REGISTER
BACK : ADD A,@R0 ;
INC R0 ; NEXT VALUE
DJNZ R7, BACK ;
END
; FOR EXTERNAL MEMORY
MOV DPTR, #0200H; STORE EXTERNAL MEMORY ADDRESS IN R0
MOV A, #00H ; CLEAR ACCUMULATOR
MOV R7, #00H ; SUM REGISTER
MOV R6, #07 ; COUNTER REGISTER
BACK : MOVX A, @DPTR ;
ADD A, R7 ;
MOV R7, A ;
INC DPTR ;
DJNZ R6, BACK ;
END
No comments:
Post a Comment