Creating Macros
Hi,
I have already created some macros for use in my own ASM code, but I am wondering if it is possible to create a macro to print text that follows it, for example: Code:
Print "text" I tried doing the following, but it seems to just end up pointing the address registers to nothing! Code:
Print MACRO Is it possible to do this in DevPac 3.18? |
One way of doing it (you may have to change the syntax for DevPac):
Code:
Print macro |
You can get rid of the branch instruction when you put the strings into another section (e.g. "data"). Or put them into a second code section and rely on the linker to merge it with your main code section, due to PC-relative references (or force the merge with some small-code option).
A separate section for strings also has the advantage that you don't need to align the address after each definition. Code:
Print macro Code:
SECTIONS { |
Thanks for the help guys :)
|
All times are GMT +2. The time now is 03:35. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.