home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
lansystk.zip
/
SAMPLE
/
MPTS
/
SAMPLDOS
/
APPENDS.ASM
next >
Wrap
Assembly Source File
|
1998-05-08
|
5KB
|
180 lines
PAGE ,132
;
; This file contains all the appendage routines
;
;
;
;
TITLE appends
;;
%OUT MASM - LARGE MODEL ASSEMBLY
;;
;; Define the ARGUMENT BASE relative to BP
;;
@AB EQU 6
;;
;; Define all of the IBMC segments
;;
_TEXT SEGMENT BYTE PUBLIC 'CODE' ; Default code segment
_TEXT ENDS
NULL SEGMENT PARA PUBLIC 'BEGDATA' ; Null pointer assignment check
NULL ENDS
_DATA SEGMENT WORD PUBLIC 'DATA' ; Default data segment
_DATA ENDS
CONST SEGMENT WORD PUBLIC 'CONST' ; Read only constants
CONST ENDS
_BSS SEGMENT WORD PUBLIC 'BSS' ; Uninitialized static data
_BSS ENDS
STACK SEGMENT PARA STACK 'STACK' ; Stack segment
STACK ENDS
;;
DGROUP GROUP NULL,_DATA,CONST,_BSS,STACK
_TEXT SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:_TEXT,DS:DGROUP
;;
CCBspin label dword
CCBspin_off dw 0
CCBspin_seg dw 0
RECspin label dword
RECspin_off dw 0
RECspin_seg dw 0
DLCspin label dword
DLCspin_off dw 0
DLCspin_seg dw 0
;
; General CCB completion handler
;
; Simply modifies the extern four-byte variable CCBADDR to the
; address of the completing CCB. The mainline program will be
; "spinning" on this variable which it set to zero before invoking
; the CCB.
;
PUBLIC _CCBCpltApp
_CCBCpltApp PROC far
cli ; we don't want to be bothered
push ax ; housekeeping
push ds
push si
lds si,CCBspin ; get the saved address into ds:si
mov ds:[si],bx ; save bs as the offset there
mov ax,es
mov ds:[si+2],ax ; save es as the segment there
pop si ; housekeeping
pop ds
pop ax
sti ; reenable interrupts
iret ; and exit the interrupt
_CCBCPLTAPP ENDP
; General Received Data handler
;
; Simply modifies the extern four-byte variable RECADDR to the
; address of the received buffer. The mainline program will be
; "spinning" on this variable which it set to zero before invoking
; starting the receive.
;
PUBLIC _RecDataApp
_RecDataApp PROC far
cli ; we don't want to be bothered
push ax ; housekeeping
push ds
push si
lds si,RECspin ; get the saved address into ds:si
mov ds:[si],bx ; save bs as the offset there
mov ax,es
mov ds:[si+2],ax ; save es as the segment there
pop si ; housekeeping
pop ds
pop ax
sti ; reenable interrupts
iret ; and exit the interrupt
_RecDataApp ENDP
;
;
;
; DLC status change handler
;
; Simply modifies the extern four-byte variable DLCADDR to the
; address of the DLC status table. The mainline program will be
; "spinning" on this variable which it set to zero before beginning
; to wait for the status change. The two-byte variable DLCLANA
; is also set to the adapter number causing the interrupt.
;
PUBLIC _DlcStatApp
_DlcStatApp PROC far
cli ; we don't want to be bothered
push ax ; housekeeping
push ds
push si
lds si,DLCspin ; get the saved address into ds:si
mov ds:[si],bx ; save bs as the offset there
mov ax,es
mov ds:[si+2],ax ; save es as the segment there
pop si ; housekeeping
pop ds
pop ax
sti ; reenable interrupts
iret
_DlcStatApp ENDP ; and exit the interrupt
;
; Appendage initialization function
;
; Accepts the addresses of the three spin variables that the
; appendages will modify upon entry.
;
; Returns nothing.
;
ccbloc = @AB ; location on the stack
recloc = @AB+4
dlcloc = @AB+8
PUBLIC _appinit
_appinit PROC far
push bp ; housekeeping
mov bp,sp
push si
push ds
lds si,ccbloc[bp] ; save the address of CCBADDR
mov cs:CCBspin_off,si
mov ax,ds
mov cs:CCBspin_seg,ax
lds si,recloc[bp] ; save the address of RECADDR
mov cs:RECspin_off,si
mov ax,ds
mov cs:RECspin_seg,ax
lds si,dlcloc[bp] ; save the address of DLCADDR
mov cs:DLCspin_off,si
mov ax,ds
mov cs:DLCspin_seg,ax
pop ds ; housekeeping
pop si
pop bp
ret ; and return
_appinit ENDP
_TEXT ENDS
end