contrib: replace the GPLv2-or-later license tag
[openocd.git] / contrib / loaders / erase_check / stm8_erase_check.s
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 /*
4 * Copyright (C) 2017 Ake Rehnman
5 * ake.rehnman(at)gmail.com
6 */
7 ;;
8 ;; erase check memory code
9 ;;
10 .org 0x0
11 ;; start address
12 start_addr: .byte 0x00
13 .word 0x8000
14 ;; byte count
15 byte_cnt: .byte 0x00
16 .word 0x8000
17 ;
18 ; SP must point to start_addr on entry
19 ; first relocate start_addr to the location
20 ; we are running at
21 start:
22 ldw X,SP
23 ldw .cont+2,X
24 ldw X,(start_addr+1,SP) ;start addr
25 ldw Y,(byte_cnt+1,SP) ;count
26 ld A,#0xff
27 ;
28 ; if count == 0 return
29 .L1:
30 tnzw Y
31 jrne .decrcnt ;continue if low word != 0
32 tnz (byte_cnt,SP) ;high byte
33 jreq .exit ;goto exit
34 ;
35 ; decrement count (byte_cnt)
36 .decrcnt:
37 tnzw Y ;low word count
38 jrne .decr1
39 dec (byte_cnt,SP) ;high byte
40 .decr1:
41 decw Y; decr low word
42 ;
43 ; first check if [start_addr] is 0xff
44 .cont:
45 ldf A, [start_addr.e]
46 cp A,#0xff
47 jrne .exit ;exit if not 0xff
48 ;
49 ; increment start_addr (addr)
50 incw X
51 jrne .L1
52 inc (start_addr,SP) ;increment high byte
53 jra .L1
54 ;
55 .exit:
56 ldw (start_addr+1,SP),X ;start addr
57 ldw (byte_cnt+1,SP),Y ;count
58 break

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)