blob: 38da5afdd1b417651a6781e575a3ed8e5e685130 (
plain) (
blame)
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
|
/*
Copyright 2022 Gabriel Jensen.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#include <agbx/priv.h>
agbx_i10 agbx_get10(agbx_i20 const _addr) {
agbx_i10 val;
__asm__ ( \
"ldrh %0,[%1]"
: "=r" (val)
: "r" (_addr)
: "memory"
);
return val;
}
agbx_i20 agbx_get20(agbx_i20 const _addr) {
agbx_i20 val;
__asm__ ( \
"ldr %0,[%1]"
: "=r" (val)
: "r" (_addr)
: "memory"
);
return val;
}
agbx_i8 agbx_get8(agbx_i20 const _addr) {
agbx_i8 val;
__asm__ ( \
"ldrb %0,[%1]"
: "=r" (val)
: "r" (_addr)
: "memory"
);
return val;
}
|