Saturday, April 30, 2016

8051 Program – internal ram to external ram

; copy data from internal ram to external ram
ORG 0H
IRAM_ADDR EQU 40H
ERAM_ADDR EQU 4000H
BYTE_COUNT EQU 10
MAIN :
MOV R0,#IRAM_ADDR
MOV R7,#BYTE_COUNT
MOV A, #0
memfill:MOV @R0,A
INC A
INC R0
DJNZ R7,memfill
MOV R0,#IRAM_ADDR
MOV DPTR, #ERAM_ADDR
MOV R7,#BYTE_COUNT
LCALL COPY
SJMP MAIN
COPY:
MOV A, #0
loop: MOV A, @R0
MOVX @DPTR, A
INC R0
INC DPTR
DJNZ R7, loop
RET
END



Related topics:
8051 Program - clear register banks   |   8051 Program - clear bit memory   |   8051 Program - clear stack memory   |   8051 Program - rom to ram   |   8051 Program - external ram to internal ram   |   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