c语言教学11(C language teaching 11)
c语言教学11(C language teaching 11)
Six compilation mode overview
Turbo C provides six compilation mode. The compilation mode is sometimes called addressing mode or
The memory model, because it is processing is how to process data in memory, stack allocation
The space and access them, these six kinds of mode: Micro mode tiny, mode small small, compact
In mode compact, mode medium, mode large, mode huge giant. Between them
The relationship is shown in the table.
Of small procedures, procedures
- - thought - Thought
Small data, micro, small, medium
Big data, compact, large, giant
The so-called small program is only one program, certainly not more than 64K bytes, default
The code pointer is near (function). The so-called big program is a program segment, each segment is not
More than 64K bytes, but the total amount of more than 64K bytes of program code pointer, the default is far. place
It is only a small data data segment, the default data pointer is near. The so-called big data
Is there a plurality of data segments, the default data pointer is far. The following will be talked about them one by one
The difference between and by the same procedure in six different output modes, to a
To further deepen the understanding of these six kinds of modes. But to emphasize one point: regardless of what kind of compiler
The Turbo C model, a single source file is not possible to generate more than 64K bytes of code, can
Generate static more than 64K bytes (including global data). For example, the following program:
Int a[15000], b[20000];
Void (main) {}
In any mode are not compiled. This is because the total storage capacity required up to two arrays
70K bytes. The compiler will be at a "Too much global data defined in file"
The error message. In order to deal with more than 64K bytes of code or static data, must be divided into several
A source file. In this example, the file can be divided into A1.C and A2.C, respectively
The giant model of the two compiled source files, finally c