<--  back   Last regenerated: 2017-07-25 18:23:10 kio

zasm - Z80 Assembler – Version 4.0

Including C Source Files

#local and #endlocal

This defines a local scope for normal label definitions. This way you can safely use 'standard' names for jump targets in included files without worrying about name collissions. You can still push Pseudo instructions: Label definition
Numeric expressions: Labels
8080 Assembler: Labels
labels to the global scope though.

Assembler directives: #local and #endlocal
Including C Source Files: #local and #endlocal
#local contexts can be nested.

#insert: Examples:
#assert: Example:
incbin: Examples:
Example: Wrap an included source file to avoid Pseudo instructions: Label definition
Numeric expressions: Labels
8080 Assembler: Labels
label name conflicts.
Note: zasm does this automatically for c files, but not for assembler files:

Assembler directives: #local and #endlocal
Including C Source Files: #local and #endlocal
#local Assembler directives: #include
Including C Source Files: #include
#include "util/u.asm" Assembler directives: #local and #endlocal
Including C Source Files: #local and #endlocal
#endlocal

Define global variables from inside a Assembler directives: #local and #endlocal
Including C Source Files: #local and #endlocal
#local context:

Assembler directives: #local and #endlocal
Including C Source Files: #local and #endlocal
#local boo:: ld a,0 ; '::' makes 'boo' global .globl fax fax: ret ; 'fax' is now also global #define bar 4711 ; Pseudo instructions: Label definition
Numeric expressions: Labels
8080 Assembler: Labels
labels defined with #define are also global. Assembler directives: #local and #endlocal
Including C Source Files: #local and #endlocal
#endlocal

Note: used but locally undefined Pseudo instructions: Label definition
Numeric expressions: Labels
8080 Assembler: Labels
labels are automatically pushed to the surrounding scope by Assembler directives: #local and #endlocal
Including C Source Files: #local and #endlocal
#endlocal and will finally reach the global scope, Assembler directives: #if, #elif, #else, #endif
Pseudo instructions: if, endif
if they were not defined in an intermediate surrounding Assembler directives: #local and #endlocal
Including C Source Files: #local and #endlocal
#local scope. There they can be picked up and resolved by the #include: #include library
#include: #include library
#include library
directive.

The .globl Pseudo instructions
8080 Assembler: 8080 pseudo instructions
pseudo instruction can also be used to make sure that a certain Pseudo instructions: Label definition
Numeric expressions: Labels
8080 Assembler: Labels
label is global and not accidentially defined in a surrounding Assembler directives: #local and #endlocal
Including C Source Files: #local and #endlocal
#local scope.

Valid HTML   Valid CSS