c++ - Borland x86 inlined assembler; get a label's address? -


i using borland turbo c++ inlined assembler code, presumably turbo assembler (tasm) style assembly code. wish following:

void foo::bar( void ) {     __asm     {       mov eax, somelabel       // ...     }     // ... somelabel:     // ... } 

so address of somelabel placed eax. doesn't work , compiler complains of: undefined symbol 'somelabel'.

in microsoft assembler (masm) dollar symbol ($) serves current location counter, useful purpose. again not seem work in borlands assember (expression syntax error).

update: little more specific, need compiler generate address moves eax constant during compilation/linking , not @ run time, compile "mov eax, 0x00401234".

can suggest how working?

update: respond pax's question (see comment), if base address changed @ run time windows loader dll/exe pe image still relocated windows loader , labels address patched @ run time loader use re-based address using compile/link time value label address not issue.

many in advance.

last time tried make assembly code borland-compatible came across limitation can't forward-reference labels. not sure if that's you're running here.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -