How to replace a number of instructions with my macros?
Posted: Mon Oct 11, 2010 6:12 am
Hi all,
I would like to redirect a number of instructions to my own functions.
For doing that, I created a header file which defines a macro for any instruction I want to replace like that:
Now, if I include my header file and write an inline assembly code like that:
I want the assembler to replace cli call with a call to my cli().
Is it possible to achieve something like that or I should explicitly call my functions from the inline assembly code?
Thank you very much for your time.
I would like to redirect a number of instructions to my own functions.
For doing that, I created a header file which defines a macro for any instruction I want to replace like that:
Code: Select all
#define cli() __asm__ ("nop":::"memory")
...
Code: Select all
asm("cli");
Is it possible to achieve something like that or I should explicitly call my functions from the inline assembly code?
Thank you very much for your time.