C++ builder中有没有与VC中的__LOCAL_SIZE相对应的预定义变量。

zhc 2002-08-20 11:42:24
__LOCAL_SIZE在VC中有编译器定义,其含义如下:

The compiler provides a symbol, __LOCAL_SIZE, for use in the inline assembler block of function prolog code. This symbol is used to allocate space for local variables on the stack frame in your custom prolog code.

The compiler determines the value of __LOCAL_SIZE. Its value is the total number of bytes of all user-defined locals as well as compiler-generated temporary variables. __LOCAL_SIZE can be used as an immediate operand; it cannot be used in an expression. You must not change or redefine the value of this symbol. For example:

mov eax, __LOCAL_SIZE ;Immediate operand
mov eax, [ebp - __LOCAL_SIZE] ;Expression

The following is a example of a naked function containing custom prolog and epilog sequences using the __LOCAL_SIZE symbol in the prolog sequence:

__declspec ( naked ) func()
{
int i;
int j;

_asm /* prolog */
{
push ebp
mov ebp, esp
sub esp, __LOCAL_SIZE
}

/* Function body */

__asm /* epilog */
{
mov esp, ebp
pop ebp
ret
}
}

...全文
115 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
RedProgramer 2002-08-20
  • 打赏
  • 举报
回复
这个变量好象没有
zhc 2002-08-20
  • 打赏
  • 举报
回复
这个不是宏,而是在编译时,有编译器预定义的值。
glyc 2002-08-20
  • 打赏
  • 举报
回复
你在头文件中搜索这个宏的定义,复制到你的程序中就可以了.
zhc 2002-08-20
  • 打赏
  • 举报
回复
如何获得该值,我需要该写一个VC代码,使它在BC中编译。

13,871

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧