This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Broken memcpy() in 68K


Hi,

I am porting some 68K C source code from HP-UX to GCC/Cygwin and I
found out the memcpy.S in newlib/libc/machine/m68k/memcpy.S is not
working when the src is not aligned.

I did a quick fix like this until I can submit a more clean fix-up
(and learn too on how to do it).

SYM(memcpy):
??????? move.l? 4(sp),a0??????? | dest ptr
??????? move.l? 8(sp),a1??????? | src ptr
??????? move.l? 12(sp),d1?????? | len
1:
??????? move.b? (a1)+,(a0)+???? | move single byte

#if !defined (__mcoldfire__)
??????? dbra??? d1,1b?????????? | loop until done
#else
??????? subq.l? #1,d1
??????? bpl???? 1b
#endif
??????? move.l? 4(sp),d0??????? | return value
??????? rts

Robert Morin
Montreal


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]