proc.md
July 7, 2025 ยท View on GitHub
Asmc Macro Assembler Reference
PROC
Marks start and end of a procedure block called label. The statements in the block can be called with the CALL instruction or INVOKE directive.
Syntax
label PROC [distance] [language-type] [PUBLIC | PRIVATE | EXPORT] [<prologuearg>] [USES reglist] [, parameter [:tag] ...] [FRAME [:ehandler-address]]
statements
label ENDP
Remarks
[FRAME [:ehandler-address]] is only valid in 64-bit, and causes ASMC to generate a function table entry in .pdata and unwind information in .xdata for a function's structured exception handling unwind behavior. When the FRAME attribute is used, it must be followed by an .ENDPROLOG directive.
The [distance] and [language-type] arguments are valid only in 32-bit.
The standard prologue and epilogue code recognizes three operands passed in the <prologuearg> list, USESDS, LOADDS and FORCEFRAME. These operands modify the prologue code.
Specifying USESDS saves DS if @DataSize and SI is used. In TINY, SMALL, and MEDIUM memory model ES is set to DS. Specifying LOADDS saves and initializes DS. Specifying FORCEFRAME as an argument generates a stack frame even if no arguments are sent to the procedure and no local variables are declared. If your procedure has any parameters or locals, you do not need to specify FORCEFRAME.