Inline functions (or something like it) - is it posible?

Everything else that doesn't fall into one of the other PB categories.
Tipperton
Addict
Addict
Posts: 1286
Joined: Thu Jun 19, 2003 7:55 pm

Inline functions (or something like it) - is it posible?

Post by Tipperton »

To protect and license my software I use Armadillo. Armadillo has some features that I want to be able to use that require special tags be inserted into the code.

I first tried this as user libraries but found that PB simply calls the function (which makes sense), but what I need is for the code to be inserted "in-line".

I could do it like this:

Code: Select all

PB code
! DB 0xEB,0x03,0x??,0x??,0x?? ; special_tag
; The "0xEB,0x03" is just a branch around the rest of the tag.
more PB code
But from what I've read, if I use this method, PB will insert register save and restore code around the in-line assembler code. This wouldn't be a problem while testing the program before protecting it with Armadillo, but I believe that the register save and restore code would cause stack problems after the program is protected because in some cases the the save code would be executed but the restore code wouldn't or the save code wouldn't be executed while the restore code would be.

It would just be more convient if I could do it like this:

Code: Select all

PB code
special_tag
more PB code
or

Code: Select all

PB code
special_tag()
more PB code
and not have the register save and restore code inserted.

Is this possible?
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post by Pupil »

I don't think PB inserts register save code when you use the '!'. Lines beginning with '!' is passed directly to FASM. Use the /commented switch to see the asm output to verify...
Tipperton
Addict
Addict
Posts: 1286
Joined: Thu Jun 19, 2003 7:55 pm

Post by Tipperton »

Pupil wrote:I don't think PB inserts register save code when you use the '!'. Lines beginning with '!' is passed directly to FASM. Use the /commented switch to see the asm output to verify...
Thanks...I did think of doing that just to be sure after I posted the message. Just haven't done it yet... :roll:
Post Reply