Last change
on this file since 444 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
537 bytes
|
Line | |
---|
1 | #include "setarch.h" |
---|
2 | |
---|
3 | #include "defines.h" |
---|
4 | |
---|
5 | ; dst A0 |
---|
6 | ; src A1 |
---|
7 | ; len A2 |
---|
8 | .global ___reg_memcpy |
---|
9 | ___reg_memcpy: |
---|
10 | |
---|
11 | MOVP A0P,A3P ; keep copy of result |
---|
12 | ADDP A2P,A0P ; point to end of dst |
---|
13 | ADDP A2P,A1P ; point to end of src |
---|
14 | CMPP A0P,A3P ; see if anything to do |
---|
15 | beq quit |
---|
16 | |
---|
17 | loop: |
---|
18 | #ifdef __NORMAL_MODE__ |
---|
19 | sub #1,A1P ; point to byte |
---|
20 | #else |
---|
21 | subs #1,A1P ; point to byte |
---|
22 | #endif |
---|
23 | mov.b @A1P,A2L ; get byte |
---|
24 | mov.b A2L,@-A0P ; save byte |
---|
25 | CMPP A0P,A3P ; at the front again ? |
---|
26 | bne loop |
---|
27 | |
---|
28 | ; return with A0 pointing to dst |
---|
29 | quit: rts |
---|
30 | |
---|
Note: See
TracBrowser
for help on using the repository browser.