home *** CD-ROM | disk | FTP | other *** search
/ The Equalizer BBS / equalizer-bbs-collection_2004.zip / equalizer-bbs-collection / DEMOSCENE-STUFF / IMPHOB10.ZIP / IMP10_EX.ZIP / W_GEMMIS.ZIP / GEMMIS.INC < prev    next >
Text File  |  1995-05-15  |  5KB  |  202 lines

  1. ;║ A FLAT REAL MODE INITIALIZER EXAMPLE
  2. ;║ ────────────────────────────────────
  3. ;║
  4. ;║ Compliant with RAW, XMS or EMS environments
  5. ;║
  6. ;║ Documentation used :
  7. ;║ microsoft eXtended Memory Specification (XMS) ver 3.0
  8. ;║ lotus/intel/microsoft Expanded Memory Specification (EMS) ver 4.0
  9. ;║ microsoft undocumented Global EMM Import Specification (GEMMIS) ver 1.11
  10. ;║
  11. ;║ Documentation needed :
  12. ;║ standard method for detecting drivers which use the VDISK allocation scheme
  13. ;║   (this is an official publication by microsoft but I don't have it)
  14. ;║
  15. ;║ (c) Walken / IMPACT Studios in 1995 - for publication in Imphobia #10
  16. ;╚════════════════════════════════════════════════════════════════════════════
  17.  
  18. ;│ Legal stuff :
  19. ;│ This document can be copyed only when unmodified and in its entirety.
  20. ;│ Commercial use - including commercial distribution or use in commercial
  21. ;│   software - is strictly prohibited without the written permission
  22. ;│   of the author.
  23. ;│ The author excludes any and all implied warranties, including warranties
  24. ;│   of merchantability and fitness for a particular purpose. The author
  25. ;│   should have no liability for special, incidental, or consequential
  26. ;│   damages arising out or resulting from the use or modification of this
  27. ;│   source code.
  28. ;└────────────────────────────────────────────────────────────────────────────
  29.  
  30. ;║ You can contact the author at the following address :
  31. ;║ Walken / IMPACT Studios
  32. ;║ Michel LESPINASSE - 18 rue Jean Giono - 80090 Amiens - FRANCE
  33. ;╚════════════════════════════════════════════════════════════════════════════
  34.  
  35.     .data
  36. dump_version db "GEMMIS version : $"
  37. dump_size db " size : $"
  38. dump_umb db " -> UMB frame : "
  39. umb_status db ".... index : $"
  40. dump_ems db " -> EMS frame $"
  41. dump_umb_frame_descriptor_1 db "UMB frame descriptor $"
  42. dump_umb_frame_descriptor_2 db " : $"
  43. dump_ems_info_record_1 db "EMS info record $"
  44. dump_ems_info_record_2 db " : handle $"
  45. dump_ems_info_record_3 db ' "'
  46. dump_ems_name db '        " size $'
  47. dump_ems_info_record_4 db " pages",13,10,"$"
  48.     .code
  49.  
  50.     ;******************************************************;
  51.     ;* dump of the GEMMIS data table in a readable format *;
  52.     ;******************************************************;
  53.     ; this code is slooooow because of the multiple calls
  54.     ; to DOS interrupts while running in flat real mode
  55.  
  56.     mov esi,d import_buffer
  57.     xor ax,ax
  58.     mov es,ax
  59.     mov dx,o dump_version
  60.     call dump_msg
  61.     mov ax,w import_buffer+4
  62.     xchg al,ah
  63.     call dump_word
  64.     mov dx,o dump_size
  65.     call dump_msg
  66.     mov ax,es:[esi+2]
  67.     call dump_word
  68.     call dump_line
  69.     mov cx,64
  70.     add esi,10
  71.     xor ebx,ebx
  72. dump_ems_frame_status_record:
  73.     mov al,es:[esi]
  74.     test al,3ch
  75.     jnz umb_dump_frame_status_record
  76.     test al,3
  77.     jnz common_dump_frame_status_record
  78.     mov ax,bx
  79.     call dump_word
  80.     mov dx,o dump_ems
  81.     call dump_msg
  82.     call dump_line
  83.     jmp common_dump_frame_status_record
  84. umb_dump_frame_status_record:
  85.     mov ax,bx
  86.     call dump_word
  87.     mov d umb_status,"...."
  88.     mov al,es:[esi]
  89.     test al,4
  90.     jz no_umb_1
  91.     mov umb_status[0],"U"
  92. no_umb_1:
  93.     test al,8
  94.     jz no_umb_2
  95.     mov umb_status[1],"U"
  96. no_umb_2:
  97.     test al,16
  98.     jz no_umb_3
  99.     mov umb_status[2],"U"
  100. no_umb_3:
  101.     test al,32
  102.     jz no_umb_4
  103.     mov umb_status[3],"U"
  104. no_umb_4:
  105.     mov dx,o dump_umb
  106.     call dump_msg
  107.     mov al,es:[esi+1]
  108.     call dump_byte
  109.     call dump_line
  110. common_dump_frame_status_record:
  111.     add esi,6
  112.     add bx,400h
  113.     loop dump_ems_frame_status_record
  114.     movzx cx,b es:[esi+1]
  115.     add esi,2
  116.     jcxz no_umb_frame_descriptors
  117.     xor bl,bl
  118. dump_umb_frame_descriptor:
  119.     mov dx,o dump_umb_frame_descriptor_1
  120.     call dump_msg
  121.     mov al,bl
  122.     call dump_byte
  123.     mov dx,o dump_umb_frame_descriptor_2
  124.     call dump_msg
  125.     mov eax,es:[esi]
  126.     shl eax,12
  127.     call dump_dword
  128.     call dump_space
  129.     mov eax,es:[esi+4]
  130.     shl eax,12
  131.     call dump_dword
  132.     call dump_space
  133.     mov eax,es:[esi+8]
  134.     shl eax,12
  135.     call dump_dword
  136.     call dump_space
  137.     mov eax,es:[esi+12]
  138.     shl eax,12
  139.     call dump_dword
  140.     call dump_line
  141.     inc bl
  142.     add esi,16
  143.     loop dump_umb_frame_descriptor
  144. no_umb_frame_descriptors:
  145.     movzx cx,b es:[esi]
  146.     inc esi
  147.     or cx,cx
  148.     jz no_ems_info_records
  149.     xor bl,bl
  150. dump_ems_info_record:
  151.     mov dx,o dump_ems_info_record_1
  152.     call dump_msg
  153.     mov al,bl
  154.     call dump_byte
  155.     mov dx,o dump_ems_info_record_2
  156.     call dump_msg
  157.     mov al,es:[esi]
  158.     call dump_byte
  159.     mov eax,es:[esi+2]
  160.     mov d dump_ems_name,eax
  161.     mov eax,es:[esi+6]
  162.     mov d dump_ems_name+4,eax
  163.     mov dx,o dump_ems_info_record_3
  164.     call dump_msg
  165.     mov ax,es:[esi+10]
  166.     mov bp,ax
  167.     call dump_word
  168.     mov dx,o dump_ems_info_record_4
  169.     call dump_msg
  170.     mov edi,es:[esi+12]
  171.     or bp,bp
  172.     jz no__
  173. dump_ems_info_record_addr:
  174.     call dump_space
  175.     mov eax,es:[edi]
  176.     and ax,0f000h
  177.     call dump_dword
  178.     call dump_space
  179.     mov eax,es:[edi+4]
  180.     and ax,0f000h
  181.     call dump_dword
  182.     call dump_space
  183.     mov eax,es:[edi+8]
  184.     and ax,0f000h
  185.     call dump_dword
  186.     call dump_space
  187.     mov eax,es:[edi+12]
  188.     and ax,0f000h
  189.     call dump_dword
  190.     call dump_line
  191.     add edi,16
  192.     dec bp
  193.     jnz dump_ems_info_record_addr
  194. no__:
  195.     inc bl
  196.     add esi,16
  197.     dec cx
  198.     jnz dump_ems_info_record
  199. no_ems_info_records:
  200.     call dump_line
  201.     call dump_line
  202.