Dear All,
This symbol used in MASM32:
@CodeSize Returns an integer representing the default code distance.
I'm trying to understand what 'default code distance' means?
Tony
Dear All,
This symbol used in MASM32:
@CodeSize Returns an integer representing the default code distance.
I'm trying to understand what 'default code distance' means?
Tony
Very probably the maximum distance (in bytes, in memory) between the two most distant pieces of code. This might influence how jumps are generated, since there can be different instructions capable of different jump lengths. A shorter jump can be encoded with a shorter (smaller, often faster) instruction.
This page mentions what integer values one can expect:
0 for TINY, SMALL, COMPACT, and FLAT models, and 1 for MEDIUM, LARGE, and HUGE models (numeric equate).
The default code distance is either NEAR or FAR.
@CodeSize can take two values, either 0 or 1, which determines if jumps, calls etc. are in NEAR or FAR distance.
If you are using the TINY, SMALL, COMPACT or FLAT memory model, all jumps etc. are NEAR, and @CodeSize == 0. If you are using the HUGE, LARGE, MEDIUM memory model, als jumps etc. are FAR and @CodeSize == 1.