summaryrefslogtreecommitdiff
path: root/riscv/riscv-probe/env/common/rv32/macros.s
diff options
context:
space:
mode:
Diffstat (limited to 'riscv/riscv-probe/env/common/rv32/macros.s')
-rw-r--r--riscv/riscv-probe/env/common/rv32/macros.s23
1 files changed, 23 insertions, 0 deletions
diff --git a/riscv/riscv-probe/env/common/rv32/macros.s b/riscv/riscv-probe/env/common/rv32/macros.s
new file mode 100644
index 0000000..d987d0c
--- /dev/null
+++ b/riscv/riscv-probe/env/common/rv32/macros.s
@@ -0,0 +1,23 @@
+# See LICENSE for license details.
+
+.equ REGBYTES, 4
+
+.macro lx a, b
+lw \a, \b
+.endm
+
+.macro sx a, b
+sw \a, \b
+.endm
+
+.macro lxsp a, b
+lw \a, ((\b)*REGBYTES)(sp)
+.endm
+
+.macro sxsp a, b
+sw \a, ((\b)*REGBYTES)(sp)
+.endm
+
+.macro .ptr a
+.4byte \a
+.endm