From 5930cdc0b571b3e5ae8d96206b4772bb802fbf5f Mon Sep 17 00:00:00 2001 From: 7u83 <7u83@mail.ru> Date: Wed, 5 Jun 2024 08:43:04 +0200 Subject: [PATCH] New function: long_xcpy --- Makefile | 2 +- long_xcpy.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 long_xcpy.c diff --git a/Makefile b/Makefile index 1263750..fbd52f8 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ LIBSRC = uart_init_.c uart_send_chr.c uart_send_str.c \ sevenseg_dec.c sevenseg_dec_inv.c \ int_to_bcd.c getbutton.c \ getpin.c setpin_lo.c setpin_hi.c setpin.c getport.c \ - long_xadd.c long_xsub.c long_xset.c long_xrlc.c long_xdiv.c + long_xadd.c long_xsub.c long_xset.c long_xrlc.c long_xdiv.c long_xcpy.c LIBOBJ =$(patsubst %.c,%.rel, $(LIBSRC)) LIBNAME=mc8051fun.lib diff --git a/long_xcpy.c b/long_xcpy.c new file mode 100644 index 0000000..4bc4724 --- /dev/null +++ b/long_xcpy.c @@ -0,0 +1,18 @@ + + + +void long_xcpy() __naked +{ + __asm + .globl long_xcpy +long_xcpy: + movx a,@r1 + movx @r0,a + inc r0 + inc r1 + djnz r7,long_xcpy + ret + __endasm; +} + +