📄 wmodels.gml
字号:
.if '&lang' eq 'C' or '&lang' eq 'C/C++' .do begin
far pointers to data
.do end
.if '&lang' eq 'FORTRAN 77' .do begin
arrays which exceed 64K bytes in total size
.do end
can be described as a mixed memory model.
In an application such as this, most of the data is in a 64K segment
(DGROUP) and hence can be referenced with near pointers relative to
the segment value in segment register DS.
This results in more efficient code being generated and better
execution times than one can expect from a big data model.
.if '&lang' eq 'C' or '&lang' eq 'C/C++' .do begin
Data objects outside of the DGROUP segment are described with the
.kw far
keyword.
.do end
.*
.section Linking Applications for the Various Memory Models
.*
.np
Each memory model requires different run-time and floating-point
libraries.
Each library assumes a particular memory model and should be linked
only with modules that have been compiled with the same memory model.
The following table lists the libraries that are to be used to link an
application that has been compiled for a particular memory model.
.if '&lang' eq 'C' or '&lang' eq 'C/C++' .do begin
.if '&machsys' eq 'QNX' .do begin
.millust begin
Memory Run-time Floating-Point Floating-Point
Model Library Calls Library Library (80x87)
------- -------- -------------- ---------------
small clibs.lib maths.lib math87s.lib
+(no)emu87.lib*
medium clibm.lib mathm.lib math87m.lib
+(no)emu87.lib*
compact clibc.lib mathc.lib math87c.lib
+(no)emu87.lib*
large clibl.lib mathl.lib math87l.lib
+(no)emu87.lib*
huge clibh.lib mathh.lib math87h.lib
+(no)emu87.lib*
.millust end
.do end
.el .do begin
.millust begin
Memory Run-time Floating-Point Floating-Point
Model Library Calls Library Library (80x87)
------- -------- -------------- ---------------
tiny CLIBS.LIB MATHS.LIB MATH87S.LIB
+CSTART_T.OBJ +(NO)EMU87.LIB*
small CLIBS.LIB MATHS.LIB MATH87S.LIB
+(NO)EMU87.LIB*
medium CLIBM.LIB MATHM.LIB MATH87M.LIB
+(NO)EMU87.LIB*
compact CLIBC.LIB MATHC.LIB MATH87C.LIB
+(NO)EMU87.LIB*
large CLIBL.LIB MATHL.LIB MATH87L.LIB
+(NO)EMU87.LIB*
huge CLIBH.LIB MATHH.LIB MATH87H.LIB
+(NO)EMU87.LIB*
.millust end
.do end
.np
* One of
.fi emu87.lib
or
.fi noemu87.lib
will be used with the 80x87 math
libraries depending on the use of the "fpi" (include emulation) or
.if &version gt 90 .do begin
"fpi87"
.do end
.el .do begin
.if '&machine' eq '80386' .do begin
"fpi87/fpi287"
.do end
.if '&machine' eq '8086' .do begin
"fpi87/fpi387"
.do end
.do end
(do not include emulation) options.
.do end
.if '&lang' eq 'FORTRAN 77' .do begin
.code begin
Library Memory Floating-point
model model
------- ------ --------------
flibm.lib /mm /fpc
flibl.lib /ml, /mh /fpc
flib7m.lib /mm /fpi, /fpi87
flib7l.lib /ml, /mh /fpi, /fpi87
clibm.lib /mm /fpc, /fpi, /fpi87
clibl.lib /ml, /mh /fpc, /fpi, /fpi87
mathm.lib /mm, /fpc
mathl.lib /ml, /mh /fpc
math87m.lib /mm, /fpi, /fpi87
math87l.lib /ml, /mh /fpi, /fpi87
emu87.lib /mm, /ml, /mh /fpi
noemu87.lib /mm, /ml, /mh /fpi87
.code end
.do end
.if '&lang' eq 'C' or '&lang' eq 'C/C++' .do begin
.if '&machsys' ne 'QNX' .do begin
.*
.section Creating a Tiny Memory Model Application
.*
.np
Tiny memory model programs are created by compiling all modules with
the small memory model option and linking in the special
initialization file "CSTART_T.OBJ".
This file is found in the WATCOM C
.fi LIB286\DOS
directory.
It must be the first object file specified when linking the program.
:cmt.exe2. Once the program is linked, the "EXE2COM" program (provided with
:cmt.exe2. WATCOM C) can be run to convert the EXE file into a COM file.
:cmt.exe2. :I1.EXE2COM:I2.command line format
:cmt.exe2. :I1.command line format:I2.EXE2COM
:cmt.exe2. .mbigbox
:cmt.exe2. EXE2COM [option] exe_file [output_file]
:cmt.exe2. .embigbox
:cmt.exe2. .pc
:cmt.exe2. The square brackets [ ] denote items which are optional.
:cmt.exe2. .begpoint
:cmt.exe2. .mnote option
:cmt.exe2. is an option of the form "/<number>" which is used to define the
:cmt.exe2. starting offset of the COM file.
:cmt.exe2. By default, it is 0x0100.
:cmt.exe2. In certain cases, you might wish to specify a different starting offset.
:cmt.exe2. For example, when creating a device driver file (file extension ".SYS"),
:cmt.exe2. the starting offset should be 0x0000.
:cmt.exe2. The syntax for
:cmt.exe2. .sy <number>
:cmt.exe2. follows the C syntax for integer constants.
:cmt.exe2. .mnote exe_file
:cmt.exe2. is the DOS file specification of the executable file that will be
:cmt.exe2. converted to a COM file.
:cmt.exe2. If omitted, a file extension of "EXE" is assumed.
:cmt.exe2. If the period "." is specified but not the extension, the file is
:cmt.exe2. assumed to have no file extension.
:cmt.exe2. .mnote output_file
:cmt.exe2. is the optional DOS file specification of the COM file to
:cmt.exe2. be created.
:cmt.exe2. If omitted, a file extension of "COM" is assumed.
:cmt.exe2. If the period "." is specified but not the extension, the file is
:cmt.exe2. assumed to have no file extension.
:cmt.exe2. If
:cmt.exe2. .sy output_file
:cmt.exe2. is not specified then the output file will have the same name as
:cmt.exe2. .sy exe_file
:cmt.exe2. except that the file extension will be "COM".
:cmt.exe2. .endpoint
.np
The following sequence will create the executable file
"MYPROG.COM" from the file "MYPROG.C":
.exam begin
C>wcc myprog /ms
C>wlink system com file myprog
.exam end
.pc
Most of the details of linking a "COM" program are handled by the
"SYSTEM COM" directive (see the
.fi wlsystem.lnk
file for details).
When linking a "COM" program, the message "Stack segment not found" is
issued.
This message may be ignored.
:cmt.exe2. .np
:cmt.exe2. The following command demonstrates the creation of a device driver
:cmt.exe2. file.
:cmt.exe2. .exam begin
:cmt.exe2. C>exe2com /0 mouse mdriver.sys
:cmt.exe2. .exam end
:cmt.exe2. .pc
:cmt.exe2. The file "MOUSE.EXE" is converted to COM file format and is stored in
:cmt.exe2. the file "MDRIVER.SYS".
:cmt.exe2. The starting offset is 0.
:cmt.exe2. .*
:cmt.exe2. .section EXE2COM Error Diagnostics
:cmt.exe2. .*
:cmt.exe2. .np
:cmt.exe2. The following error messages may be issued by EXE2COM.
:cmt.exe2. .begnote $break
:cmt.exe2. .mnote Usage: EXE2COM [/start_offset] file [outfile]
:cmt.exe2. The command line was entered incorrectly.
:cmt.exe2. .mnote Expecting filename
:cmt.exe2. A file name was not specified on the command line.
:cmt.exe2. .mnote Unable to open %s
:cmt.exe2. The specified file %s could not be opened.
:cmt.exe2. Check that the file exists.
:cmt.exe2. .mnote EXE file too large
:cmt.exe2. The executable (EXE) file contains more than 64K of code and data.
:cmt.exe2. .mnote STACK segment ignored
:cmt.exe2. The "STACK" segment in an EXE file is not included in the COM file.
:cmt.exe2. .mnote Invalid start address
:cmt.exe2. The entry point offset of the EXE file does not correspond to the
:cmt.exe2. starting offset of the COM file.
:cmt.exe2. The default starting offset for a COM file is 0x0100 unless
:cmt.exe2. otherwise specified on the command line.
:cmt.exe2. .mnote EXE file contains relocation entries
:cmt.exe2. To convert an EXE file to a COM file, the executable file must not
:cmt.exe2. contain relocation entries.
:cmt.exe2. .mnote Not a valid EXE file
:cmt.exe2. The specified file does not have the proper format of an EXE file.
:cmt.exe2. .mnote Not enough memory
:cmt.exe2. Not enough memory is available to run the program.
:cmt.exe2. .endnote
.do end
.do end
.im wmemlay
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -