contrib: replace the GPLv2-or-later license tag
[fw/openocd] / contrib / loaders / checksum / armv4_5_crc.s
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 /***************************************************************************
4  *   Copyright (C) 2010 by Spencer Oliver                                  *
5  *   spen@spen-soft.co.uk                                                  *
6  ***************************************************************************/
7
8 /*
9         r0 - address in - crc out
10         r1 - char count
11 */
12
13         .text
14         .arm
15
16 _start:
17 main:
18         mov             r2, r0
19         mov             r0, #0xffffffff /* crc */
20         mov             r3, r1
21         mov             r4, #0
22         b               ncomp
23 nbyte:
24         ldrb    r1, [r2, r4]
25         ldr             r7, CRC32XOR
26         eor             r0, r0, r1, asl #24
27         mov             r5, #0
28 loop:
29         cmp             r0, #0
30         mov             r6, r0, asl #1
31         add             r5, r5, #1
32         mov             r0, r6
33         eorlt   r0, r6, r7
34         cmp             r5, #8
35         bne             loop
36         add             r4, r4, #1
37 ncomp:
38         cmp             r4, r3
39         bne             nbyte
40 end:
41         bkpt    #0
42
43 CRC32XOR:       .word   0x04c11db7
44
45         .end