diff --git a/docs/assembler/masm/proto.md b/docs/assembler/masm/proto.md index 4d6df6754c..25491dc441 100644 --- a/docs/assembler/masm/proto.md +++ b/docs/assembler/masm/proto.md @@ -1,7 +1,7 @@ --- title: "PROTO | Microsoft Docs" ms.custom: "" -ms.date: "08/30/2018" +ms.date: "10/22/2018" ms.technology: ["cpp-masm"] ms.topic: "reference" f1_keywords: ["PROTO"] @@ -14,12 +14,44 @@ ms.workload: ["cplusplus"] --- # PROTO -Prototypes a function. +Prototypes a function or procedure. You can call the function prototyped by the PROTO directive by using the [INVOKE](https://docs.microsoft.com/en-us/cpp/assembler/masm/invoke?view=vs-2017) directive. ## Syntax -> *label* PROTO [[*distance*]] [[*langtype*]] [[, [[*parameter*]]:*tag*]]... +> *label* **PROTO** \[*distance*] \[*langtype*] \[__,__ \[*parameter*]__:__*tag*] ... + +### Parameters + +*label*
+The name of the prototyped function. + +*distance*
+(Optional) Used in 16-bit memory models to override the default and indicate **NEAR** or **FAR** calls. + +*langtype*
+(Optional) Sets the calling and naming convention for procedures and public symbols. Supported conventions are: + +- 32-bit **FLAT** model: **C**, **STDCALL** + +- 16-bit models: **C**, **BASIC**, **FORTRAN**, **PASCAL**, **SYSCALL**, **STDCALL** + +*parameter*
+The optional name for a function parameter. + +*tag*
+The type of a function parameter. + +The *parameter* and *tag* parameters may appear multiple times, once for each passed argument. + +## Example + +This sample shows a **PROTO** declaration for a function named `addup3` that uses a **NEAR** call to override the 16-bit model default for procedure calls, and uses the **C** calling convention for stack parameters and return values. It takes two arguments, a **WORD** and a **VARARG**. + +```MASM +addup3 PROTO NEAR C, argcount:WORD, arg1:VARARG +``` ## See also -[Directives Reference](../../assembler/masm/directives-reference.md)
\ No newline at end of file +[Directives Reference](directives-reference.md)
+[.MODEL Reference](dot-model.md)