⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpwcc.gml

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 GML
📖 第 1 页 / 共 5 页
字号:
keyword to describe functions and other object names that are in near
memory and pointers to near objects.
.np
&product predefines the macros
.kwm near
and
.kwm _near
to be equivalent to the
.kwm __near
keyword.
.*
.note __far &optdag.
.ix 'keywords' '__far'
&product supports the
.kwm __far
keyword to describe functions and other object names that are in far
memory and pointers to far objects.
.np
&product predefines the macros
.kwm far,
.kwm _far
and
.kwm SOMDLINK
(16-bit only)
to be equivalent to the
.kwm __far
keyword.
.*
.note __huge &optdag.
.ix 'keywords' '__huge'
&product supports the
.kwm __huge
keyword to describe functions and other object names that are in huge
memory and pointers to huge objects.
The 32-bit compilers treat these as equivalent to far objects.
.np
&product predefines the macros
.kwm huge
and
.kwm _huge
to be equivalent to the
.kwm __huge
keyword.
.note __based
.ix 'keywords' '__based'
.ix 'segment references'
&product supports the
.kwm __based
keyword to describe pointers to objects that appear in other segments
or the objects themselves.
See the section entitled :HDREF refid='wccbase'. for an explanation of
the
.kwm __based
keyword.
.np
&product predefines the macro
.kwm _based
to be equivalent to the
.kwm __based
keyword.
.*
.note __segment
.ix 'keywords' '__segment'
.ix 'segment references'
&product supports the
.kwm __segment
keyword which is used when describing objects of type segment.
See the section entitled :HDREF refid='wccbase'. for an explanation of
the
.kwm __segment
keyword.
.np
&product predefines the macro
.kwm _segment
to be equivalent to the
.kwm __segment
keyword.
.*
.note __segname
.ix 'keywords' '__segname'
.ix 'segname references'
&product supports the
.kwm __segname
keyword which is used when describing segname constant based pointers
or objects.
See the section entitled :HDREF refid='wccbase'. for an explanation of
the
.kwm __segname
keyword.
.np
&product predefines the macro
.kwm _segname
to be equivalent to the
.kwm __segname
keyword.
.*
.note __self
.ix 'keywords' '__self'
.ix 'self references'
&product supports the
.kwm __self
keyword which is used when describing self based pointers.
See the section entitled :HDREF refid='wccbase'. for an explanation of
the
.kwm __self
keyword.
.np
&product predefines the macro
.kwm _self
to be equivalent to the
.kwm __self
keyword.
.*
.note __restrict
.ix 'keywords' '__restrict'
&product provides the
.kw __restrict
type qualifier as an alternative to the ISO C99
.kw restrict
keyword; it is supported even when C99 keywords aren't visible. This type
qualifier is used as an optimization hint. Any object accessed through a
.kw restrict
qualified pointer may only be accessed through that pointer and the compiler
may assume that there will be no aliasing.
.*
.note _Packed
.ix 'keywords' '_Packed'
.ix 'segment references'
&product supports the
.kwm _Packed
keyword which is used when describing a structure.
If specified before the
.kw struct
keyword, the compiler will force the structure to be packed (no
alignment, no gaps) regardless of the setting of the command-line
option or the
.kw #pragma
controlling the alignment of members.
.*
.note __cdecl
.ix 'keywords' '__cdecl'
&product supports the
.kwm __cdecl
keyword to describe C functions that are called using a special
convention.
.autonote Notes:
.note
All symbols are preceded by an underscore character.
.note
Arguments are pushed on the stack from right to left.
That is, the last argument is pushed first.
The calling routine will remove the arguments from the stack.
.note
Floating-point values are returned in the same way as structures.
When a structure is returned, the called routine returns a pointer
in register AX/EAX to the return value which is stored in the data
segment (DGROUP).
.note
For the 16-bit compiler, registers AX, BX, CX and DX, and segment
register ES are not saved and restored when a call is made.
.note
For the 32-bit compiler, registers EAX, ECX and EDX are not saved and
restored when a call is made.
.endnote
.np
&product predefines the macros
.kwm cdecl,
.kwm _cdecl,
.kwm _Cdecl
and
.kwm SOMLINK
(16-bit only) to be equivalent to the
.kwm __cdecl
keyword.
.*
.note __pascal
.ix 'keywords' '__pascal'
&product supports the
.kwm __pascal
keyword to describe Pascal functions that are called using a special
convention described by a pragma in the "stddef.h" header file.
.np
&product predefines the macros
.kwm pascal,
.kwm _pascal
and
.kwm _Pascal
to be equivalent to the
.kwm __pascal
keyword.
.*
.note __fortran &optdag.
.ix 'keywords' '__fortran'
&product supports the
.kwm __fortran
keyword to describe functions that are called from FORTRAN.
It converts the name to uppercase letters and suppresses the "_" which
is appended to the function name for certain calling conventions.
.np
&product predefines the macros
.kwm fortran
and
.kwm _fortran
to be equivalent to the
.kwm __fortran
keyword.
.*
.note __interrupt &optdag.
.ix 'keywords' '__interrupt'
.ix 'interrupt routine'
&product supports the
.kwm __interrupt
keyword to describe a function that is an interrupt handler.
.exam begin 8
#include <i86.h>

void __interrupt int10( union INTPACK r )
{
        .
        .
        .
}
.exam end
.pc
The code generator will emit instructions to save all registers.
The registers are saved on the stack in a specific order so that they
may be referenced using the "INTPACK" union as shown in the DOS
example above.
.ix 'DS segment register'
The code generator will emit instructions to establish addressability
to the program's data segment since the DS segment register contents
are unpredictable.
The function will return using an "IRET" (16-bit) or "IRETD" (32-bit)
(interrupt return) instruction.
.np
&product predefines the macros
.kwm interrupt
and
.kwm _interrupt
to be equivalent to the
.kwm __interrupt
keyword.
.*
.note __declspec( modifier )
.ix 'keywords' '__declspec'
&product supports the
.kwm __declspec
keyword for compatibility with Microsoft C++.
The
.kwm __declspec
keyword is used to modify storage-class attributes of functions and/or
data.
There are several modifiers that can be specified with the
.kwm __declspec
keyword:
.kwm thread,
.kwm naked,
.kwm dllimport,
.kwm dllexport,
.kwm __pragma( "string" ),
.kwm __cdecl,
.kwm __pascal,
.kwm __fortran,
.kwm __stdcall,
and
.kwm __syscall.
These attributes are a property only of the declaration of the
object or function to which they are applied.
Unlike the
.kwm __near
and
.kwm __far
keywords, which actually affect the type of object or function (in
this case, 2- and 4-byte addresses), these storage-class attributes do
not redefine the type attributes of the object itself.
The
.kwm __pragma
modifier is supported by &cmppname only.
The
.kwm thread
attribute affects data and objects only.
The
.kwm naked,
.kwm __pragma,
.kwm __cdecl,
.kwm __pascal,
.kwm __fortran,
.kwm __stdcall,
and
.kwm __syscall
attributes affect functions only.
The
.kwm dllimport
and
.kwm dllexport
attributes affect functions, data, and objects.
For more information on the
.kwm __declspec
keyword, please see the section entitled :HDREF refid='wccdecl'..
.*
.note __export
.ix 'keywords' '__export'
.ix 'dynamic link library' 'exporting functions'
.ix 'DLL' 'exporting functions'
&product supports the
.kwm __export
keyword to describe functions and other object names that are to be
exported from a Microsoft Windows DLL,
OS/2 DLL, or Netware NLM.
See also the description of the "zu" option.
.exam begin 6
void __export _Setcolor( int color )
{
        .
        .
        .
}
.exam end
.np
&product predefines the macro
.kwm _export
to be equivalent to the
.kwm __export
keyword.
.*
.note __loadds &optdag.
.ix 'keywords' '__loadds'
.ix 'DS segment register'
&product supports the
.kwm __loadds
keyword to describe functions that require specific loading of the DS
register to establish addressability to the function's data segment.
.ix 'dynamic link library'
.ix 'DLL'
This keyword is useful in describing a function that will be placed in
a Microsoft Windows
or OS/2 1.x Dynamic Link Library (DLL).
See also the description of the "nd" and "zu" options.
.exam begin 6
void __export __loadds _Setcolor( int color )
{
        .
        .
        .
}
.exam end
.np
If the function in an OS/2 1.x Dynamic Link Library requires access to
private data, the data segment register must be loaded with an
appropriate value since it will contain the DS value of the calling
application upon entry to the function.
.np
&product predefines the macro
.kwm _loadds
to be equivalent to the
.kwm __loadds
keyword.
.*
.note __saveregs &optdag.
.ix 'keywords' '__saveregs'
&product recognizes the
.kwm __saveregs
keyword which is an attribute used by C/C++ compilers to describe a
function that must save and restore all registers.
.np
&product predefines the macro
.kwm _saveregs
to be equivalent to the
.kwm __saveregs
keyword.
.*
.note __stdcall &optdag.
.ix 'keywords' '__stdcall'
(32-bit only)
The
.kwm __stdcall
keyword may be used with function definitions, and indicates that the
32-bit Win32 calling convention is to be used.
.autonote Notes:
.note
All symbols are preceded by an underscore character.
.note
All C symbols (extern "C" symbols in C++) are suffixed by "@nnn" where
"nnn" is the sum of the argument sizes (each size is rounded up to a
multiple of 4 bytes so that char and short are size 4).
When the argument list contains "...", the "@nnn" suffix is omitted.
.note
Arguments are pushed on the stack from right to left.
That is, the last argument is pushed first.
The called routine will remove the arguments from the stack.
.note
When a structure is returned, the caller allocates space on the stack.
The address of the allocated space will be pushed on the stack
immediately before the call instruction.
Upon returning from the call, register EAX will contain address of
the space allocated for the return value.
Floating-point values are returned in 80x87 register ST(0).
.note
Registers EAX, ECX and EDX are not saved and restored when a call is
made.
.endnote
.*
.note __syscall &optdag.
.ix 'keywords' '__syscall'
(32-bit only)
The
.kwm __syscall
keyword may be used with function definitions, and indicates that the
calling convention used is compatible with functions provided by
32-bit OS/2.
.autonote Notes:
.note
Symbols names are not modified, that is, they are not adorned with
leading or trailing underscores.
.note
Arguments are pushed on the stack from right to left.
That is, the last argument is pushed first.
The calling routine will remove the arguments from the stack.
.note
When a structure is returned, the caller allocates space on the stack.
The address of the allocated space will be pushed on the stack
immediately before the call instruction.
Upon returning from the call, register EAX will contain address of
the space allocated for the return value.
Floating-point values are returned in 80x87 register ST(0).
.note
Registers EAX, ECX and EDX are not saved and restored when a call is
made.
.endnote
.np
&product predefines the macros
.kwm _syscall,
.kwm _System,
.kwm SOMLINK
(32-bit only)
and
.kwm SOMDLINK
(32-bit only) to be equivalent to the
.kwm __syscall
keyword.
.*
.note __far16 &optdag.
.ix 'keywords' '__far16'
(32-bit only)
&product recognizes the
.kwm __far16
keyword which can be used to define far 16-bit (far16) pointers
(16-bit selector with 16-bit offset) or far 16-bit function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -