MASM指令选项序言:无效

发布于 2025-01-26 16:46:50 字数 904 浏览 3 评论 0原文

我正在学习如何使用MSM的官方文档使用MASM,但是option> option>指令( https://learn.microsoft.com/en-us/cpp/cpp/assembler/masm/masm/masm/poption-mast-mast 170 )。它被用于memcpy的标准库实现中,它似乎可以正常工作

我的代码:


title entry - general purpose testing ground for asm operations
include ksamd64.inc
        subttl  "entry"

    NESTED_ENTRY entry, _TEXT
    option PROLOGUE:NONE, EPILOGUE:NONE
;       error here: "A2220 Missing .ENDPROLOGUE"
        cvtpi2ps xmm0, qword ptr[rcx]
        rsqrtps xmm1, xmm0
        movaps xmmword ptr[rcx], xmm1
    
        cvtpi2ps xmm0, qword ptr[rcx+8]
        rsqrtps xmm1, xmm0
        movups xmmword ptr[rcx+8], xmm1
    .beginepilog
        ret
    NESTED_END entry, _TEXT
end

I'm learning how to use masm using MS's official docs, but there's almost nothing written on the option directive (https://learn.microsoft.com/en-us/cpp/assembler/masm/option-masm?view=msvc-170). It was used in the standard library implementation of memcpy where it seems to work properly

my code:


title entry - general purpose testing ground for asm operations
include ksamd64.inc
        subttl  "entry"

    NESTED_ENTRY entry, _TEXT
    option PROLOGUE:NONE, EPILOGUE:NONE
;       error here: "A2220 Missing .ENDPROLOGUE"
        cvtpi2ps xmm0, qword ptr[rcx]
        rsqrtps xmm1, xmm0
        movaps xmmword ptr[rcx], xmm1
    
        cvtpi2ps xmm0, qword ptr[rcx+8]
        rsqrtps xmm1, xmm0
        movups xmmword ptr[rcx+8], xmm1
    .beginepilog
        ret
    NESTED_END entry, _TEXT
end

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

z祗昰~ 2025-02-02 16:46:50

确实记录了很差,但是您的代码不是混合版本/环境吗?我从 的不同角落挖出了以下信息。

大约代码>

标志着序言声明的末尾。
proc frame.endprolog中,使用区域以外的任何序言声明是错误的。


大约

a nested_entry必须具有关联的prolog_end(SH-4)和entry> entry_end_end(SH-4)。

大约

此宏必须按照nested_entry(SH-4)或laf_entry(SH-4)宏。

它出现在prolog区域之后和匹配entry_end_end(SH-4)宏。

大约

此宏结束由nested_entry(SH-4)或laf_entry(SH-4)。
语法entry_end [name]
名称应与nested_entrylaf_entry宏观。
中使用的名称相同
entry_end(SH-4)宏当前忽略名称。


您没有使用prolog_end,而是写nested_end而不是entry> entry_end_end

为什么您使用短语选项序言:无,结语:无?也许只是将其删除...

Indeed poorly documented, but is your code not mixing versions/environments?. I have dug up following info from different corners of the web.

About .ENDPROLOG

Signals the end of the prologue declarations.
It is an error to use any of the prologue declarations outside of the region between PROC FRAME and .ENDPROLOG.


About NESTED_ENTRY

A NESTED_ENTRY must have an associated PROLOG_END (SH-4) and ENTRY_END (SH-4).

About PROLOG_END

This macro must appear following a NESTED_ENTRY (SH-4) or LEAF_ENTRY (SH-4) macro.
It appears after the prolog area and before the matching ENTRY_END (SH-4) macro.

About ENTRY_END

This macro ends the current routine specified by NESTED_ENTRY (SH-4) or LEAF_ENTRY (SH-4).
Syntax ENTRY_END[Name]
Name should be the same name used in the NESTED_ENTRY or LEAF_ENTRY macros.
The ENTRY_END (SH-4) macro currently ignores Name.


You didn't use PROLOG_END and you wrote NESTED_END instead of ENTRY_END.

Why do you use the phrase option PROLOGUE:NONE, EPILOGUE:NONE? Perhaps simply remove it...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文