【问题标题】:What is the string length when parameter passing in asm?asm中传入参数时的字符串长度是多少?
【发布时间】:2010-10-18 19:58:43
【问题描述】:

我将两个字符串从 c 文件传递​​到 asm 文件作为参数。然后我将这些从堆栈移动到 ecx 和 edx。我怎么能确切地知道它们的长度是多少?像 c 中的 strlen(string) 一样吗?

    push ebp
    mov  ebp,esp
    mov  ecx,[ebp+8]
    mov  edx,[ebp+12]

【问题讨论】:

    标签: assembly parameter-passing nasm


    【解决方案1】:

    strlen (et.al.) 使用尾随的 NUL '\0' 字符来指示字符串的结尾。您的 asm 也可以这样做。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-16
      相关资源
      最近更新 更多