- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Make macros for assembler language
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-23-2000 11:53 PM
тАО11-23-2000 11:53 PM
Make macros for assembler language
I found a begin of explication in m4. But i don't have example on my hp server.
I cannot use #define because i need, when the macro is expanded, to repect the asm format:
label opcode opcode_param information
and each line must on separte line (not as C).
Somebody can help me?
- Tags:
- ASM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2000 12:03 AM
тАО11-24-2000 12:03 AM
Re: Make macros for assembler language
Edit with vi you main code.
At every line where you want to insert your macro code do
:r
this inserts the contents of
Of course this is a manual procedure, hope this is what you need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2000 12:44 AM
тАО11-24-2000 12:44 AM
Re: Make macros for assembler language
Instead of typing
:r file
to insert the file at cursor position from within vi
you could as well use the include statement, like in
#include "you_macro_file"
The disadvantage of these 2 solutions is that the same file will be used.
To allow for minor changes, you should probably modify your initial asm file with some conditional steps like
#ifdef
#else
#endif
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-24-2000 02:52 AM
тАО11-24-2000 02:52 AM
Re: Make macros for assembler language
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-05-2000 01:22 AM
тАО12-05-2000 01:22 AM
Re: Make macros for assembler language
-put a "!" between each instructions
-put a "\" to change line in the declaration like for C
-Use .LABEL directive to make a LABEL inside the macro and don't add any instruction after: use ! between the label and the instruction.
-To create local label use macro's arguments like the exemple at the end; the #arg will keep the "#" inside the label name!!!!
-Don't forget the "; macro" at the end of the description.
Exemple
#define Toto(var1,var2) .EXPORT label#var1#var2,CODE ! .LABEL label#var1#var2 ! ldi var1,r1 ! ldi var2,r2 ; macro
In source write this:
Toto(13,14)
will create this:
.EXPORT label#13#14,CODE
label#13#14
ldi 13,r1
ldi 14,r2
in c code, add this to know address (and jum perhaps...): extern "C" void label#13#14();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-05-2000 02:10 AM
тАО12-05-2000 02:10 AM
Re: Make macros for assembler language
it's impossible, i think, to export in a C source the label, because the "#" cause an error in compilation. But inside assembly code it's work.
But the declaration work fine if you use good declaration like: extern "C" void label_13_14();