aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/armdebug/Debugger/debug_macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'AT91SAM7S256/armdebug/Debugger/debug_macros.h')
-rw-r--r--AT91SAM7S256/armdebug/Debugger/debug_macros.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/AT91SAM7S256/armdebug/Debugger/debug_macros.h b/AT91SAM7S256/armdebug/Debugger/debug_macros.h
index 416022e..f66e42c 100644
--- a/AT91SAM7S256/armdebug/Debugger/debug_macros.h
+++ b/AT91SAM7S256/armdebug/Debugger/debug_macros.h
@@ -91,6 +91,23 @@
sub \deststrptr, \deststrptr, #1 /* Adjust Destination string pointer to point at NULL character */
.endm
+/* _dbg_memcpy
+ * _dbg_stpcpy macro
+ * On entry:
+ * deststrptr: Destination string [Cannot be R0]
+ * sourcestrptr: Source string [Cannot be R0]
+ * sizereg: Number of bytes to copy [Cannot be R0]
+ * On exit:
+ * deststrptr: Pointer to NULL character in destination string
+ * R0: destroyed
+ */
+ .macro _dbg_memcpy deststrptr, sourcestrptr, sizereg
+1: ldrb r0, [\sourcestrptr], #1
+ strb r0, [\deststrptr], #1
+ subs \sizereg, \sizereg, #1
+ bne 1b
+ .endm
+
/* _dbg_outputMsgValidResponse
* Return Message with valid response ('+$')
* On exit: