;/*****************************************************************************
;*
;* SOURCE FILE NAME = CS_HELP.ASM
;*
;* DESCRIPTIVE NAME =
;*
;* COPYRIGHT    COPYRIGHT IBM CORPORATION, 1991, 1992 - PATENT PENDING
;*              LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
;*              REFER TO COPYRIGHT INSTRUCTION FORM#G120-2083
;*              RESTRICTED MATERIALS OF IBM
;*              IBM CONFIDENTIAL
;*
;* VERSION
;*
;* DATE
;*
;* DESCRIPTION
;*
;* FUNCTIONS
;*
;*
;* NOTES        NONE
;*
;* STRUCTURES   NONE
;*
;* EXTERNAL REFERENCES
;*
;*              NONE
;*
;* EXTERNAL FUNCTIONS
;*
;*              NONE
;*
;* CHANGE ACTIVITY =
;*   DATE      FLAG        APAR   CHANGE DESCRIPTION
;*   --------  ----------  -----  --------------------------------------
;*   mm/dd/yy  @Vr.mpppxx  xxxxx  xxxxxxx
;*****************************************************************************/

.286
.287

;*
;* constant definitions
;*

ATTACHDD equ 42


_DATA   SEGMENT WORD PUBLIC 'DATA'
_DATA   ENDS

_BSS    SEGMENT WORD PUBLIC 'BSS'
_BSS    ENDS

CONST   SEGMENT WORD PUBLIC 'CONST'
CONST   ENDS

_TEXT   SEGMENT WORD PUBLIC 'CODE'
_TEXT   ENDS

DGROUP  GROUP   _DATA, CONST, _BSS
CGRP    GROUP   _TEXT


_TEXT   SEGMENT WORD PUBLIC 'CODE'
        ASSUME cs:CGRP, ds:DGROUP, es:NOTHING, ss:NOTHING


extrn _service_callback:near


;/***************************************************************************
;*
;* FUNCTION NAME = _callback_handler
;*
;* DESCRIPTION   =
;*
;* INPUT         =
;*
;* OUTPUT        =
;*
;* RETURN-NORMAL =
;*
;* RETURN-ERROR  =
;*
;**************************************************************************/

public _callback_handler
_callback_handler proc far             ; void callback_handler(void)

            pushf                      ; save registers
            push ax
            push bx
            push cx
            push dx
            push si
            push di
            push bp
            push ds
            push es





            and ax,00ffh               ;
            push ax                    ; set up event number,
            push cx                    ; socket number and data segment
            mov ax,DGROUP              ; - service the call back
            mov ds,ax                  ;
            call _service_callback
            add sp,4

            pop es                     ; restore registers
            pop ds
            pop bp
            pop di
            pop si
            pop dx
            pop cx
            pop bx
            pop ax
            popf

            ret                        ; return

_callback_handler endp

_TEXT ENDS

        END
