summaryrefslogtreecommitdiff
path: root/tests/fixtures/hll/libc-stub.S
blob: d4fd878947e537e5f0a1e74dc3e83e0d58b4018c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
; Test/development MCPU Libc emulator.
;
; This source is NEVER installed.  The register marker is intentionally a
; testing convention only; it is not part of the CRT <-> MCPU Libc ABI.

.global __mcpu_libc_init
.global __mcpu_init_array
.global __mcpu_fini_array
.global __mcpu_libc_fini

.text
__mcpu_libc_init:
        CLR     r64@0x70008
        ICMP    r64@0x70000, r64@0x70008
        JNZ     .L_stub_bad
        LDI     r64@0x70000, 1
        RET

__mcpu_init_array:
        LDI     r64@0x70008, 1
        ICMP    r64@0x70000, r64@0x70008
        JNZ     .L_stub_bad
        LDI     r64@0x70000, 2
        RET

__mcpu_fini_array:
        LDI     r64@0x70008, 4
        ICMP    r64@0x70000, r64@0x70008
        JNZ     .L_stub_bad
        LDI     r64@0x70000, 5
        RET

__mcpu_libc_fini:
        LDI     r64@0x70008, 5
        ICMP    r64@0x70000, r64@0x70008
        JNZ     .L_stub_bad
        LDI     r64@0x70000, 6
        RET

.L_stub_bad:
        LDI     r64@0x70000, 999
        RET