5 * \brief SEED parts in assembler for AVR
15 /*******************************************************************************
17 void changeendian32(uint32_t * a){
18 *a = (*a & 0x000000FF) << 24 |
19 (*a & 0x0000FF00) << 8 |
20 (*a & 0x00FF0000) >> 8 |
21 (*a & 0xFF000000) >> 24;
26 .global changeendian32
27 ; === change_endian32 ===
28 ; function that changes the endianess of a 32-bit word
29 ; param1: the 32-bit word
30 ; given in r25,r24,r23,22 (r25 is most significant)
33 movw r20, r22 ; (r22,r23) --> (r20,r21)
42 /*******************************************************************************
43 uint32_t bigendian_sum32(uint32_t a, uint32_t b){
52 .global bigendian_sum32
53 ; === bigendian_sum32 ===
54 ; function that adds two 32-bit words in the bigendian way and returns the result
55 ; param1: the first 32-bit word
56 ; given in r25,r24,r23,22 (r25 is most significant for little endian)
57 ; param2: the second 32-bit word
58 ; given in r21,r20,r19,18 (r21 is most significant for little endian)
67 .global bigendian_sub32
68 ; === bigendian_sub32 ===
69 ; function that subtracts a 32-bit words from another in the bigendian way and returns the result
70 ; param1: the minuend 32-bit word
71 ; given in r25,r24,r23,22 (r25 is most significant for little endian)
72 ; param2: the subtrahend 32-bit word
73 ; given in r21,r20,r19,18 (r21 is most significant for little endian)