; Description:
; Copies ETX Terminated String From Code Memory To External Memory.
; ETX Is Copied.
;
; Entry Requirements:
; DPTR Points To Destination In External Memory
; R6/7 Points To Source In Code Memory
;
; On Exit:
; DPTR = Points To Source ETX + 1
; R6/7 = Points To Destination ETX + 1
;
; Affected:
; PSW.Z, PSW.P, Acc, DPTR, R6, R7
;
; Stack:
; 2 Bytes, Not Including Space Used By Called Routines
;
; Comments:
; None
;
ETX equ 3 ; ASCII ETX Character
UTIL_COPYCTODZ:
loop1: call UTIL_DPTRR67 ; DPTR=Src, R67=Dest
clr a ; Clear For MOVC
movc a,@a+dptr ; Get Character
inc dptr ; Next Source Location
call UTIL_DPTRR67 ; DPTR=Dest, R67=Src
movx @dptr,a ; Store It
inc dptr ; Next Destination Location
cjne a,#ETX,loop1 ; If ETX, Exit Copy
ret ; Return To Caller
Source: Assorted Utilities, John C. Wren 11/23/96
Related topics:
8051 Program - copy xram to iram | 8051 Program - copy iram to xram | 8051 Program - copy rom to xram | 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