C/C++ Compiler (cl.hlp) (Table of Contents; Topic list)
Memory-Model Comparison
                                             Up Contents Index Back
─────C/C++ Compiler─────────────────────────────────────────────────────────
 
     Every program's code and data are stored in blocks called
     "segments." The memory model of the program determines the
     organization of these segments. The memory model also determines
     what kind of executable file is generated. All models except tiny
     produce an .EXE file. The tiny model produces a .COM file. Any
     version of CL that targets a 32-bit system offers only the small
     memory model (/AS). The following table compares the memory-model
     options that CL offers.
     See: Custom Memory Options
 
               Memory     Data                 Code                Long
     Option    Model      Segments             Segments            Form
 
     /AT       Tiny       One segment          One segment         None
                          for both data        for both data
                          and code             and code
 
     /AS       Small      One                  One                 /Asnd
 
     /AM       Medium     One                  One code segment    /Alnd
                                               per module
 
     /AC       Compact    Multiple data        One                 /Asfd
                          segments; data
                          items must be
                          smaller than 64K
 
     /AL       Large      Multiple data        One code segment    /Alfd
                          segments; data       per module
                          items must be
                          smaller than 64K
 
     /AH       Huge       Multiple data        One code segment    /Alhd
                          segments; arrays     per module
                          can be larger
                          than 64K
                                    -♦-