From 1b9e172948db7c59299360e710219439988569dc Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Fri, 12 Jan 2018 00:18:35 -0800 Subject: [PATCH] Update README.md --- README.md | 45 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d838ddd..9ca5bc4 100644 --- a/README.md +++ b/README.md @@ -23,11 +23,13 @@ Small, fast code just isn't as important as it used to be. Still, it is a very i 6. [Section Names](#section-names) 7. [Variable Names](#variable-names) 8. [Functions](#functions) - 9. [Function Prototypes](#function-prototypes) - 10. [Section](#section) - 11. [Type Declarations](#type-declarations) - 12. [Alignment](#alignment) - 13. [Project Organization](#project-organization) + 9. [Macros](#macros) + 10. [Function Prototypes](#function-prototypes) + 11. [Section](#section) + 12. [Type Declarations](#type-declarations) + 13. [Alignment](#alignment) + 14. [Project Organization](#project-organization) + 15. [Mnemonics](#mnemonics) ## Getting Started @@ -119,7 +121,7 @@ includelib \masm32\include\user32.lib ### Case Sensitivity -*Always* use the `option casemap:none` option. This prevents the assembler from thinking `MyFunction` is the same as +*Always* use the `option casemap: none` option. This prevents the assembler from thinking `MyFunction` is the same as `myfunction`, which will save you a lot of headaches. Example: @@ -182,15 +184,29 @@ Example: WinMain EndP ``` -Additionally, place your functions toward the bottom of your code section. This keeps your actual code uncluttered, -and all of your functions in one easy-to-find place. +Additionally, place your functions toward the bottom of your code section, or in an include file. +This keeps your actual code uncluttered, and all of your functions in one easy-to-find place. + +### Macros + +Similar to functions, indent the body of the macro so it's easily differentiated from other code levels. To keep code uncluttered, +keep macros in an include file. + +For macro "arguments", separate them like you would function arguments: + +```asm +TEST macro x, y, z + ;... +endm +``` ### Function Prototypes In order to allow the use of functions at the bottom of your code, you need to declare function prototypes above the invoking code. -Place prototypes after all includes, and leave two empty lines between the includes and prototypes. +Place prototypes after all includes, and leave two empty lines between the includes and prototypes. Alternatively, store them in an +include file to keep them out of your main body of code entirely. Example: @@ -263,3 +279,14 @@ Example: ### Project Organization TODO + +### Mnemonics + +When using assembly mnemonics, separate each argument with a space. + +Example: + +```asm +xor eax, eax +shl ebx, 8 +```