summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2025-09-04 17:56:01 -0700
committerGitHub <noreply@github.com>2025-09-04 17:56:01 -0700
commit61a38830b94c28b3fcead3e22161c3dd621d25c9 (patch)
tree8ae9664d2feae319bb7da12ddd7cc7e06751f1ae /include
parenta4d5910cdb9bed05fa5aea4476a3cf4ef178be06 (diff)
Spimdisasm update (#243)HEADmain
* git subrepo pull tools/asm-processor subrepo: subdir: "tools/asm-processor" merged: "5c3984fc" upstream: origin: "git@github.com:simonlindholm/asm-processor.git" branch: "main" commit: "5c3984fc" git-subrepo: version: "0.4.9" origin: "git@github.com:ingydotnet/git-subrepo.git" commit: "ea10886" * Fix things needed for new spimdisasm release
Diffstat (limited to 'include')
-rw-r--r--include/macro.inc61
1 files changed, 54 insertions, 7 deletions
diff --git a/include/macro.inc b/include/macro.inc
index 1ee4aa4..e55380f 100644
--- a/include/macro.inc
+++ b/include/macro.inc
@@ -1,18 +1,63 @@
-.macro glabel label
- .global \label
+# Evaluate this file only once in case it's included more than once
+.ifndef _MACRO_INC_GUARD
+.internal _MACRO_INC_GUARD
+.set _MACRO_INC_GUARD, 1
+
+# A function symbol.
+.macro glabel label, visibility=global
+ .\visibility \label
.type \label, @function
\label:
+ .ent \label
.endm
-.macro dlabel label
- .global \label
- \label:
+# The end of a function symbol.
+.macro endlabel label
+ .size \label, . - \label
+ .end \label
.endm
-.macro jlabel label
- .global \label
+# An alternative entry to a function.
+.macro alabel label, visibility=global
+ .\visibility \label
.type \label, @function
\label:
+ .aent \label
+.endm
+
+# A label referenced by an error handler table.
+.macro ehlabel label, visibility=global
+ .\visibility \label
+ \label:
+.endm
+
+
+# A label referenced by a jumptable.
+.macro jlabel label, visibility=global
+ .\visibility \label
+ \label:
+.endm
+
+
+# A data symbol.
+.macro dlabel label, visibility=global
+ .\visibility \label
+ .type \label, @object
+ \label:
+.endm
+
+# End of a data symbol.
+.macro enddlabel label
+ .size \label, . - \label
+.endm
+
+
+# Label to signal the symbol haven't been matched yet.
+.macro nonmatching label, size=1
+ .global \label\().NON_MATCHING
+ .type \label\().NON_MATCHING, @object
+ .size \label\().NON_MATCHING, \size
+ \label\().NON_MATCHING:
.endm
# COP0 register aliases
@@ -85,3 +130,5 @@
.set $fs4f, $f29
.set $fs5, $f30
.set $fs5f, $f31
+
+.endif