Monday, May 30, 2016

8051 Program - copy iram to xram

; Description:
; Copy Bytes From Internal Memory To External Memory
;
; Entry Requirements:
; DPTR Points To Destination In External Memory
; R1 Points To Source In Internal Memory
; R0 Contains Number Of Bytes To Copy
;
; On Exit:
; DPTR = Points To End Of Destination + 1
; R1 Points To End Of Source + 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_COPYITOX:
loop1:mov a,@r1 ; Get Source Byte
movx @dptr,a ; Store To Destination
inc r1 ; Next Source Byte
inc dptr ; 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 xram to iram   |   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