We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3efe21a commit 2363417Copy full SHA for 2363417
2 files changed
src/macros.inc
@@ -1,5 +1,30 @@
1
+; Ralph Doncaster public domain AVR assembler macros
2
3
.macro GLABEL name
4
.global \name
5
\name:
6
.endm
7
+
8
+; in/out require an io register at address < 0x40
9
+.macro LOAD rd, ioreg
10
+ .if \ioreg > 0x3F
11
+ lds \rd, \ioreg
12
+ .else
13
+ in \rd, \ioreg
14
+ .endif
15
+.endm
16
17
+.macro STORE ioreg, rr
18
19
+ sts \ioreg, \rr
20
21
+ out \ioreg, \rr
22
23
24
25
+; example: X_ldiw 24, 12345
26
+.macro X_ldiw rd, K
27
+ ldi \rd, lo8(\K)
28
+ ldi (\rd)+1, hi8(\K)
29
30
src/millis.S
@@ -10,6 +10,7 @@
GLABEL millis_impl
ldi ZL, lo8(t0_millis)
ldi ZH, hi8(t0_millis)
+; X_ldiw 30, t0_millis ; Z = t0_millis
_reload:
ld r22, Z
ldd r23, Z+1
0 commit comments