You are on page 1of 3

1. Move data from on-chip SRAM 40H-5FH to on-chip SRAM 48H-67H.

Sol: source_add equ dest_add equ number_of_bytes equ mov mov mov mov mov dec dec djnz end 2. Move data from external Data RAM 3000H-3FFFH to external data RAM 7000H-7FFFH source_add dest_add last_dest_add source_dph_buf source_dpl_buf dest_dph_buf dest_dpl_buf mov mov mov mov AGAIN: mov mov movx inc mov mov mov mov movx inc mov mov mov cjne mov cjne nop dph, source_dph_buf dpl, source_dpl_buf A, @dptr dptr source_dph_buf, dph source_dpl_buf, dpl dph, dest_dph_buf dpl, dest_dpl_buf @dptr, A dptr dest_dph_buf, dph dest_dpl_buf, dpl r3, dpl r3,#LOW(last_dest_add+1),AGAIN r3, dph r3,#HIGH(last_dest_add+1), AGAIN end 3. Move data from ROM 3000H-3FFFH equ equ equ equ equ equ equ 3000H 7000H 7FFFH 30H 31H 32H 33H 5fH 67H 20H

L1:

r1,#dest_add r0,#source_add r2,#number_of_bytes A,@r0 @r1,A r0 r1 r2, L1

source_dph_buf, #HIGH(source_add) source_dpl_buf, #LOW(source_add) dest_dph_buf, #HIGH(dest_add) dest_dpl_buf, #LOW(dest_add)

to external data RAM 4000H-4FFFH source_add dest_add last_dest_add source_dph_buf source_dpl_buf dest_dph_buf dest_dpl_buf mov mov mov mov AGAIN: mov mov clr movc inc mov mov mov mov movx inc mov mov mov cjne mov cjne nop dph, source_dph_buf dpl, source_dpl_buf A A, @A+dptr;;;; movx A, @dptr dptr source_dph_buf, dph source_dpl_buf, dpl dph, dest_dph_buf dpl, dest_dpl_buf @dptr, A dptr dest_dph_buf, dph dest_dpl_buf, dpl r3, dpl r3,#LOW(last_dest_add+1),AGAIN r3, dph r3,#HIGH(last_dest_add+1), AGAIN end 4. Move data from ROM 3000H-302FH to on-chip SRAM 40H-6FH source_add equ dest_add equ number_of_bytes equ mov mov mov clr movc mov inc inc djnz nop end 3000H 40H 30H equ equ equ equ equ equ equ 3000H 4000H 4FFFH 30H 31H 32H 33H

source_dph_buf, #HIGH(source_add) source_dpl_buf, #LOW(source_add) dest_dph_buf, #HIGH(dest_add) dest_dpl_buf, #LOW(dest_add)

L1:

r1,#dest_add dptr,#source_add r2,#number_of_bytes A A, @A+dptr @r1,A dptr r1 r2, L1

5. Move data from external data RAM 3000H-302FH to on-chip SRAM 40H-6FH source_add equ dest_add equ number_of_bytes equ mov mov mov movx mov inc inc djnz nop end 3000H 40H 30H

L1:

r1,#dest_add dptr,#source_add r2,#number_of_bytes A,@dptr @r1,A dptr r1 r2, L1

6. Move data from on-chip SRAM 40H-6FH to external data RAM 3000H-302FH dest_add equ source_add equ number_of_bytes equ mov mov mov mov movx inc inc djnz nop end 3000H 40H 30H

L1:

dptr,#dest_add r1,#source_add r2,#number_of_bytes A,@r1 @dptr,A dptr r1 r2, L1