home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / edos / v86api / testv86.asm < prev    next >
Encoding:
Assembly Source File  |  1992-09-22  |  1.1 KB  |  63 lines

  1.  
  2. code segment public
  3.  
  4. assume cs:code, ds:code
  5.     org 100h
  6.  
  7. start:    jmp begin
  8.  
  9. vxd_api    dd    0
  10.  
  11. ; this test program demonstrates the getting of the VxD V86 Entry point
  12. ; and the calling of a service in that entry point.
  13. ; On entry
  14. ; AX = the function to call. 
  15. ;    where ax = 0 = get version number
  16. ;     where ax = 1 = put up message box.
  17.  
  18.  
  19. begin:    
  20. ;int 3
  21.     mov ax,0
  22.     mov es,ax    
  23.     mov di,ax
  24.  
  25.     mov ax, 1684h        ; get entry point for vxd device
  26.     mov bx, 2925h        ; VxD ID of EDOS, can not be changed
  27.     int 2fh            
  28.     mov ax,es
  29.     or ax,di
  30.     jz novxd
  31.     mov word ptr [vxd_api], di
  32.     mov word ptr [vxd_api+2],es
  33.  
  34.     mov  cx,0        ; cx should be zero
  35.     mov  ax,cs
  36.     mov  dx,ax        ; dx = segment of message to use
  37.     mov  bx,offset msg    ; bx = offset of msg to use
  38.     mov  ax,1        ; message box function call
  39.     call vxd_api
  40.  
  41. exitnow:
  42.     mov ax,4c00h        ; program exit
  43.     int 21h
  44.  
  45.     ret            ; never returns to here
  46.  
  47. novxd:
  48.     mov dx, offset dumbo_msg
  49.     mov ah,9
  50.     int 21h
  51.  
  52.     jmp exitnow
  53.  
  54.  
  55.  
  56. msg db  'Test of V86 Message Alarm',0
  57.  
  58. dumbo_msg    db    'Test V86 failed, Windows not running',13,10,'$'
  59.  
  60. ends
  61.  
  62. END start
  63.