Monday, May 30, 2016

8051 Program - copy xram to iram

; Description:
; Copy String From External Memory To Internal Memory
;
; Entry Requirements:
; DPTR Points To Source In External Memory
; R1 Points To Destination In Internal Memory
; R0 Contains Number Of Bytes To Copy
;
; On Exit:
; DPTR = Points To End Of Source + 1
; R1 Points To End Of Destination + 1
; R0 = 0
;
; Affected:
; PSW.Z, PSW.P, Acc, R0, R1, DPTR
;
; Stack:
; 0 Bytes, Not Including Space Used By Called Routines
;
; Comments:
; None
;
UTIL_COPYXTOI:
loop1:movx a,@dptr ; Get Source Byte
mov @r1,a ; Store To Destination
inc dptr ; Next Source Byte
inc r1 ; Next Destination Byte
djnz r0,loop1 ; Do For R0 Bytes
ret ; Return To Caller


Source: Assorted Utilities, John C. Wren 11/23/96



Related topics:
8051 Program - copy iram to xram   |   8051 Program - copy rom to xram   |   8051 Program - copy rom to xram string   |   8051 Program - copy xram to xram   |   8051 Program - copy xram to xram string   |   8051 Program - memory subroutines   |   8051 Program - math subroutines   |   8051 Program - conversion subroutines

List of topics: 8051

No comments:

Post a Comment