-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ps2 asm prelude Updates existing macros and adds more macros to support declaring visibility for symbols
- Loading branch information
1 parent
ee9abf7
commit 83bafc6
Showing
1 changed file
with
55 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,67 @@ | ||
.macro glabel label | ||
.global \label | ||
.type \label, @function | ||
\label: | ||
.macro glabel name, visibility=global | ||
.\visibility "\name" | ||
.type "\name", @function | ||
"\name": | ||
.endm | ||
|
||
.macro dlabel label | ||
.global \label | ||
\label: | ||
.macro dlabel name, visibility=global | ||
.\visibility "\name" | ||
.type "\name", @object | ||
"\name": | ||
.endm | ||
|
||
.macro jlabel label | ||
\label: | ||
.macro jlabel name, visibility=local | ||
.\visibility "\name" | ||
"\name": | ||
.endm | ||
|
||
.macro .late_rodata | ||
.section .rodata | ||
.endm | ||
|
||
# Defines a sized symbol with function type. | ||
# Usage: | ||
# .fn my_function, local | ||
# /* asm here */ | ||
# .endfn my_function | ||
.macro .fn name, visibility=global | ||
.\visibility "\name" | ||
.type "\name", @function | ||
"\name": | ||
.endm | ||
|
||
.macro .endfn name | ||
.size "\name", . - "\name" | ||
.endm | ||
|
||
# Defines a sized symbol with object type. | ||
# Usage: | ||
# .obj my_object, local | ||
# /* data here */ | ||
# .endobj my_object | ||
.macro .obj name, visibility=global | ||
.\visibility "\name" | ||
.type "\name", @object | ||
"\name": | ||
.endm | ||
|
||
.macro .endobj name | ||
.size "\name", . - "\name" | ||
.endm | ||
|
||
# Defines a sized symbol without a type. | ||
# Usage: | ||
# .sym my_sym, local | ||
# /* anything here */ | ||
# .endsym my_sym | ||
.macro .sym name, visibility=global | ||
.\visibility "\name" | ||
"\name": | ||
.endm | ||
|
||
.macro .endsym name | ||
.size "\name", . - "\name" | ||
.endm | ||
|
||
.set noat | ||
.set noreorder |