        .xlist
; Include file - EPOCLIB.INC
; Epoc/Os plib standard include file.
; Copyright (c) Psion PLC 1989-90.
;
;  VER    DATE    BY  DESCRIPTION
; ----- -------- ---- -----------
; 2.00F 30/09/90 NSM  Final release
;
EPOCLIB_INC	equ	1
;
_TANDW	=	0
ifdef   LATTICE
CodeSeg macro
pgroup  group   prog
PGROUP	equ	<pgroup>
prog    segment byte public 'prog'
        assume  cs:pgroup
        endm
EndCodeSeg macro
prog    ends
        endm
DataSeg macro   
dgroup  group   data,udata
DGROUP	equ	<dgroup>
data    segment word public 'data'
        assume  ds:dgroup,es:dgroup,ss:dgroup
        endm
EndDataSeg macro
data    ends
        endm
UDataSeg macro  
udata   segment word public 'data'
        endm
EndUDataSeg macro
udata   ends
        endm
GLREF_D MACRO   NAME,TYPE
        EXTRN	NAME:TYPE
        ENDM
GLDEF_D MACRO   NAME,TYPE
        PUBLIC	NAME
NAME	label   TYPE
        ENDM
GLREF_C MACRO   NAME
        EXTRN	NAME:NEAR
        ENDM
endif
;
ifdef   TURBOC
_TANDW	=	1
CodeSeg macro
PGROUP  group   _TEXT
pgroup	equ	<PGROUP>
_TEXT   segment byte public 'CODE'
        assume  cs:PGROUP
        endm
EndCodeSeg macro
_TEXT   ends
        endm
DataSeg macro   
DGROUP  group   _DATA,_BSS
dgroup	equ	<DGROUP>
_DATA   segment word public 'DATA'
        assume  ds:DGROUP,es:DGROUP,ss:DGROUP
        endm
EndDataSeg macro
_DATA   ends
        endm
UDataSeg macro  
_BSS    segment word public 'BSS'
        endm
EndUDataSeg macro
_BSS    ends
        endm
GLREF_D MACRO   NAME,TYPE
        EXTRN  _&NAME:TYPE
NAME    EQU        _&NAME
        ENDM
GLDEF_D MACRO   NAME,TYPE
        PUBLIC     _&NAME
_&NAME  label    TYPE
NAME    EQU        _&NAME
        ENDM
GLREF_C MACRO   NAME
        EXTRN  _&NAME:NEAR
NAME    EQU        _&NAME
        ENDM
endif
ifdef   WATCOMC
REG_PARAM	equ	1
ifdef	_MSC
_TANDW	=	1
endif
CodeSeg macro
PGROUP  group   _TEXT
pgroup	equ	<PGROUP>
_TEXT   segment byte public 'CODE'
        assume  cs:PGROUP
        endm
EndCodeSeg macro
_TEXT   ends
        endm
DataSeg macro   
DGROUP  group   _DATA,_BSS
dgroup	equ	<DGROUP>
_DATA   segment word public 'DATA'
        assume  ds:DGROUP,es:DGROUP,ss:DGROUP
        endm
EndDataSeg macro
_DATA   ends
        endm
UDataSeg macro  
_BSS    segment word public 'BSS'
        endm
EndUDataSeg macro
_BSS    ends
        endm
GLREF_D MACRO   NAME,TYPE
        EXTRN  NAME&_:TYPE
NAME    EQU        NAME&_
        ENDM
GLDEF_D MACRO   NAME,TYPE
        PUBLIC     NAME&_
NAME&_  label    TYPE
NAME    EQU        NAME&_
        ENDM
GLREF_C MACRO   NAME
        EXTRN  NAME&_:NEAR
NAME    EQU        NAME&_
        ENDM
endif
ifdef   JPIC
REG_PARAM	equ	1
ifdef	_MSC
_TANDW	=	1
endif
CodeSeg macro
_TEXT   segment byte public 'CODE'
        assume  cs:_TEXT
        endm
EndCodeSeg macro
_TEXT   ends
        endm
DataSeg macro   
DGROUP  group   _DATA,_BSS
dgroup	equ	<DGROUP>
_DATA   segment word public 'DATA'
        assume  ds:DGROUP,es:DGROUP,ss:DGROUP
        endm
EndDataSeg macro
_DATA   ends
        endm
UDataSeg macro  
_BSS    segment word public 'BSS'
        endm
EndUDataSeg macro
_BSS    ends
        endm
GLREF_D MACRO   NAME,TYPE
        EXTRN  _&NAME:TYPE
NAME    EQU        _&NAME
        ENDM
GLDEF_D MACRO   NAME,TYPE
        PUBLIC     _&NAME
_&NAME  label    TYPE
NAME    EQU        _&NAME
        ENDM
GLREF_C MACRO   NAME
        EXTRN  _&NAME:NEAR
NAME    EQU        _&NAME
        ENDM
endif
;
LOCAL_D MACRO   NAME,TYPE
NAME    label      TYPE
        ENDM
;
ProcBegin macro _Name,_Type,_Registers
ifdef	TURBOC
	ProcBeginBody _&_Name,_Type,_Registers
endif
ifdef	JPIC
	ProcBeginBody _&_Name,_Type,_Registers
endif
ifdef	WATCOMC
	ProcBeginBody _Name&_,_Type,_Registers
_Name    EQU        _Name&_
endif
ifdef	LATTICE
	ProcBeginBody _Name,_Type,_Registers
endif
	endm
ProcBegin@ macro _Name,_Type,_Registers
	ProcBeginBody _Name,_Type,_Registers
	endm
ProcBeginBody macro _Name,_Type,_Registers
_DI = 0
_SI = 0
if	_TANDW
ifnb    <_Registers>
        irpc    _flags,_Registers
ifidni  <_flags>,<D>
_DI     = 1
endif
ifidni  <_flags>,<S>
_SI     = 1
endif
        endm
endif
endif
;
ProcEnd macro _flag
ifb     <_flag>
if      _DI
        pop     di
endif
if      _SI
        pop     si
endif
if	_TANDW
ifidni  <_Type>,<bp>
        pop     bp
endif
endif
ifdef	LATTICE
ifidni  <_Type>,<bp>
        pop     bp
endif
endif
        ret
endif
&_Name  endp
        endm
;
        public  _Name
ifidni  <_Type>,<far>
_Name   proc    far
else
_Name   proc    near
endif
ifidni  <_Type>,<bp>
if	_TANDW
        push    bp
        mov     bp, sp
endif
ifdef	LATTICE
        push    bp
        mov     bp, sp
endif
Arg1    equ     <[bp+4]>
Arg2    equ     <[bp+6]>
Arg3    equ     <[bp+8]>
Arg4    equ     <[bp+10]>
Arg5    equ     <[bp+12]>
Arg6    equ     <[bp+14]>
Arg7    equ     <[bp+16]>
Arg8    equ     <[bp+18]>
endif
ifidni  <_Type>,<bx>
if	_TANDW
        mov     bx, sp
endif
ifdef LATTICE
        mov     bx, sp
endif
Arg1    equ     <[bx+2]>
Arg2    equ     <[bx+4]>
Arg3    equ     <[bx+6]>
Arg4    equ     <[bx+8]>
Arg5    equ     <[bx+10]>
Arg6    equ     <[bx+12]>
Arg7    equ     <[bx+14]>
Arg8    equ     <[bx+16]>
endif
if      _SI
        push    si
endif
if      _DI
        push    di
endif
        endm
;
        .list
