2 * memset routine for Z8000
3 * Copyright (C) 2004 Christian Groessler <chris@groessler.org>
5 * Permission to use, copy, modify, and distribute this file
6 * for any purpose is hereby granted without fee, provided that
7 * the above copyright notice and this notice appears in all
10 * This file is distributed WITHOUT ANY WARRANTY; without even the implied
11 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 /* void *memset(void *buffer, int value, size_t length);
44 ld r1,r5 /* r1 contains value */
53 not_odd:ld r0,r3 /* remember length */
63 ldir @rr6,@rr4,r3 /* fill words */
66 bit r0,#0 /* one byte remaining? */
79 #else /* above Z8001, below Z8002 */
89 ld r2,r7 /* buffer pointer return value */
100 ld r1,r6 /* r1 contains value */
109 not_odd:ld r0,r5 /* remember length */
119 ldir @r7,@r4,r5 /* fill words */
122 bit r0,#0 /* one byte remaining? */