]> git.cryptolib.org Git - avr-crypto-lib.git/blob - memxor/memxor_p.S
fixing E-Mail-Address & Copyright
[avr-crypto-lib.git] / memxor / memxor_p.S
1 /* memxor_p.s */
2 /*
3     This file is part of the AVR-Crypto-Lib.
4     Copyright (C) 2006-2015 Daniel Otte (bg@nerilex.org)
5
6     This program is free software: you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation, either version 3 of the License, or
9     (at your option) any later version.
10
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 /*
21  * File:        memxor.S
22  * Author:      Daniel Otte
23  * Date:        2008-08-07
24  * License:     GPLv3 or later
25  * Description: memxor, XORing one block into another
26  *
27  */
28
29 /*
30  * void memxor(void *dest, const void *src, uint16_t n);
31  */
32  /*
33   * param dest is passed in r24:r25
34   * param src  is passed in r22:r23
35   * param n    is passed in r20:r21
36   */
37 .global memxor_P
38 memxor_P:
39         movw r26, r24
40         movw r30, r22
41         movw r24, r20
42         adiw r24, 0
43         breq 2f
44 1:
45         lpm r20, Z+
46         ld r21, X
47         eor r20, r21
48         st X+, r20
49         sbiw r24, 1
50         brne 1b
51 2:
52         ret