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

前端 未结 12 875
清酒与你
清酒与你 2021-01-05 03:15

I am using Borland Turbo C++ with some inlined assembler code, so presumably Turbo Assembler (TASM) style assembly code. I wish to do the following:

void foo         


        
12条回答
  •  臣服心动
    2021-01-05 03:45

    3 suggestions:

    1) put a '_' in front of the SomeLabel in the assembly so it becomes "mov eax, _SomeLabel ". Usually the compiler will add one when it translates C into assembly.

    Or

    2) put the label in an assembly section. This will prevent the compiler from adding the '_'.

    Or

    3) comment out the assembly, compile, and look in the listing file (*.lst) to see what the label name becomes.

提交回复
热议问题