Preferably, limit line lengths to 80 columns or less. When this doesn't leave sufficient space for a good postfix style comment, extend the line to a total of 120 columns. Having some level of uniformity in the expected width of the source is useful for viewing and printing the code.
Tabs shall be set in all editors to expand to two spaces. All indentation is on two space boundaries. There are no exceptions to this rule! This rule makes code look the same in all editors.
Files should be saved using either ASCII or UTF8 encoding.
Implementing hexadecimal escape sequences, '\x20' for example, is prohibited because they vary from compiler to compiler.
The ISO standard defines octal escape sequences: '\102', for example. Because of the similarity to decimal values, and octal having fallen into disuse, use of this construct is prohibited. The only exception to this rule is '\0'.
Other than '\0', the only permissible escape sequences are:
Alert: Visual or audible alert
Backspace: Move to previous position
Form Feed: Move to next logical page
New Line: Move to start of next line
Carriage Return: Move to start of line
Horiz. Tab: Move to next tab position
Vert. Tab: Move to next Vert. Tab pos.
The C language specification has defined numbers whose first digit is zero as octal, so 010 is decimal 8 The use of octal has declined considerably since C was first defined but this construct remains for backwards compatibility. Its use is prohibited. In particular, do not be tempted to use the zero prefix in tables of numbers to ensure visual alignment:
Address = 00130; // Decimal 88Address = 01450; // Decimal 808Address = 81200; // Decimal 81200
Use Windows, or MSDOS, style line endings. Do NOT use Unix / Linux / MacOS / OS-X file formats.
The last two characters in any source file within EDK II must be a CRLF: 0x0D followed by 0x0A.
Trigraphs are a construct to allow character representations that do not support all ASCII characters to enter the equivalent of the ASCII character. Trigraphs are three characters long (hence the "tri"). The first two characters are "??" while the third character disambiguates the trigraph. Technically therefore, a could be written a??(5??). Trigraphs have provided both confusing and unnecessary and are prohibited.
There are really no reasons for in-line assembler to be used in EDK II code. The only exceptions in this case are largely associated with the lowest level Architectural Protocols. Using in-line assembly language deviates against the Scope rules defined in Section 1.3 "Scope" because it is an extension to standard C. This.
The only other exception for this would be in the