kolibrios-gitea/programs/develop/open watcom/trunk/clib/crt/segdefns.asm

141 lines
3.8 KiB
NASM
Raw Normal View History

;*****************************************************************************
;*
;* Open Watcom Project
;*
;* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
;*
;* ========================================================================
;*
;* This file contains Original Code and/or Modifications of Original
;* Code as defined in and that are subject to the Sybase Open Watcom
;* Public License version 1.0 (the 'License'). You may not use this file
;* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
;* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
;* provided with the Original Code and Modifications, and is also
;* available at www.sybase.com/developer/opensource.
;*
;* The Original Code and all software distributed under the License are
;* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
;* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
;* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
;* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
;* NON-INFRINGEMENT. Please see the License for the specific language
;* governing rights and limitations under the License.
;*
;* ========================================================================
;*
;* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
;* DESCRIBE IT HERE!
;*
;*****************************************************************************
;
; segment definitions for WATCOM C/C++32
;
include langenv.inc
name segdefns
.386p
assume nothing
if COMP_CFG_COFF
DGROUP group _NULL,_AFTERNULL,CONST,_DATA,DATA,_BSS,STACK
else
ifdef __LINUX__
DGROUP group _NULL,_AFTERNULL,CONST,_DATA,DATA,TIB,TI,TIE,XIB,XI,XIE,YIB,YI,YIE,_BSS
else
DGROUP group _NULL,_AFTERNULL,CONST,_DATA,DATA,_BSS,STACK,TIB,TI,TIE,XIB,XI,XIE,YIB,YI,YIE
endif
endif
; this guarantees that no function pointer will equal NULL
; (WLINK will keep segment 'BEGTEXT' in front)
; This segment must be at least 4 bytes in size to avoid confusing the
; signal function.
BEGTEXT segment use32 word public 'CODE'
assume cs:BEGTEXT
forever label near
int 3h
jmp short forever
; NOTE that __begtext needs to be at offset 3
; don't move it. i.e. don't change any code before here.
___begtext label byte
nop
nop
nop
nop
public ___begtext
assume cs:nothing
BEGTEXT ends
assume ds:DGROUP
_NULL segment para public 'BEGDATA'
__nullarea label word
db 01h,01h,01h,00h
public __nullarea
_NULL ends
_AFTERNULL segment word public 'BEGDATA'
_AFTERNULL ends
CONST segment word public 'DATA'
CONST ends
if COMP_CFG_COFF eq 0
TIB segment byte public 'DATA'
TIB ends
TI segment byte public 'DATA'
TI ends
TIE segment byte public 'DATA'
TIE ends
XIB segment word public 'DATA'
_Start_XI label byte
public "C",_Start_XI
XIB ends
XI segment word public 'DATA'
XI ends
XIE segment word public 'DATA'
_End_XI label byte
public "C",_End_XI
XIE ends
YIB segment word public 'DATA'
_Start_YI label byte
public "C",_Start_YI
YIB ends
YI segment word public 'DATA'
YI ends
YIE segment word public 'DATA'
_End_YI label byte
public "C",_End_YI
YIE ends
endif
_DATA segment word public 'DATA'
_DATA ends
DATA segment word public 'DATA'
DATA ends
_BSS segment word public 'BSS'
_BSS ends
ifndef __LINUX__
STACK_SIZE equ 4096h
STACK segment para stack 'STACK'
db (STACK_SIZE) dup(?)
STACK ends
endif
_TEXT segment use32 word public 'CODE'
_TEXT ends
end