'masm directive option prologue:none has no effect
I'm learning how to use masm using MS's official docs, but there's almost nothing written on the option
directive (https://docs.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
Solution 1:[1]
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 associatedPROLOG_END
(SH-4) andENTRY_END
(SH-4).
About PROLOG_END
This macro must appear following a
NESTED_ENTRY
(SH-4) orLEAF_ENTRY
(SH-4) macro.
It appears after the prolog area and before the matchingENTRY_END
(SH-4) macro.
About ENTRY_END
This macro ends the current routine specified by
NESTED_ENTRY
(SH-4) orLEAF_ENTRY
(SH-4).
SyntaxENTRY_END[Name]
Name should be the same name used in theNESTED_ENTRY
orLEAF_ENTRY
macros.
TheENTRY_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...
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Sep Roland |