home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
OS2HIST.ZIP
/
OS2DEFS.ASH
< prev
next >
Wrap
Text File
|
1988-01-22
|
4KB
|
139 lines
; ***********************************************************************
; * *
; * OS2DEFS.ASH - Definitions and macros for OS/2. *
; * *
; * This file contains definitions, macros, and structures *
; * that are important for dealing with OS/2 from an assembly *
; * language program. *
; * *
; ***********************************************************************
; * *
; * Revision History: *
; * *
; * 12/05/87 MPL Created file *
; * *
; ***********************************************************************
; ***********************************************************************
; * *
; * System Constants *
; * *
; ***********************************************************************
FOREVER equ 0FFFFFFFFH ; for DOSSEMWAIT & friends
; ***********************************************************************
; * *
; * OS2CALL macro *
; * *
; * This macro is used to call OS/2 system services. The syntax *
; * for it is as follows: *
; * *
; * OS2CALL funcname,<arg1,arg2,...> *
; * *
; * If any of the arguments are more than one token (as in *
; * OFFSET foobar) they must also be enclosed in angle brackets: *
; * *
; * OS2CALL DOSPUTMESSAGE,<0,msglen,DS,<offset message>> *
; * *
; ***********************************************************************
OS2CALL macro funcname,arglist
irp x,<arglist>
push x
endm
ifndef funcname
extrn funcname:far
endif
call funcname
endm
; ***********************************************************************
; * *
; * PUSH@ macros and friends *
; * *
; * These macrosf push the addresses of objects onto the stack *
; * *
; ***********************************************************************
PUSH@ macro addr
push SEG addr
push OFFSET addr
endm
PUSH@CS macro addr
push CS
push offset CS:addr
endm
PUSH@DS macro addr
push DS
push offset DS:addr
endm
PUSH@ES macro addr
push ES
push offset ES:addr
endm
PUSH@SS macro addr
push SS
push offset SS:addr
endm
PUSHL macro addr
push word ptr addr+2
push word ptr addr+0
endm
PUSHX macro wrd
push wrd SHR 16
push wrd AND 0FFFFH
endm
; ***********************************************************************
; * *
; * ERRJMP macro *
; * *
; * This macro is used to test for OS/2 errors. The syntax for *
; * the macro is: *
; * *
; * ERRJMP place_to_go_if_errors *
; * *
; * Control will be transfered to the indicated address if AX *
; * is nonzero following an OS/2 error. *
; * *
; ***********************************************************************
ERRJMP macro whereto
local skip01
or ax,ax ; test for OS2 error
jz skip01 ; if no error continue
jmp whereto ; go to error routine
skip01:
endm
ERRJMPN macro whereto ; same as ERRJMP except
; where to go is SHORT
or ax,ax ; test for errors
jnz whereto ; jump if error
endm
; ***********************************************************************
; * *
; * OS/2 Error codes of interest *
; * *
; ***********************************************************************
ERROR_SEM_TIMEOUT equ 121 ; semaphore wait timed out