Created
November 25, 2020 20:01
-
-
Save kisssko/72cb7a0ae2bdf2370035689c6631fbf7 to your computer and use it in GitHub Desktop.
Include binary file macros
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
// (T)ype, (V)ariable, (S)ection, (F)ile. | |
#define INCBIN(T,V,S,F) \ | |
asm \ | |
( \ | |
".globl " #V "\n" \ | |
".section \"" S "\",\"a\"\n" \ | |
".balign 4\n" #V ":\n" \ | |
".incbin \"" F "\"\n" \ | |
); extern T V[] | |
// (T)ype, (V)ariable, (S)ection, (F)ile, (O)ffset. | |
#define INCBIN2(T,V,S,F,O) \ | |
asm \ | |
( \ | |
".globl " #V "\n" \ | |
".section \"" S "\",\"a\"\n" \ | |
".balign 4\n" #V ":\n" \ | |
".incbin \"" F "\"," #O "\n" \ | |
); extern T V[] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment