home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / SOFTWARE / LIBS / PMC101.ZIP / LIBSRC.ZIP / SETIRQ.ASM (.txt) < prev    next >
Assembly Source File  |  1994-06-23  |  2KB  |  143 lines

  1. .386p
  2. locals
  3.  
  4. include pmc.inc
  5.  
  6. extrn   IV_PMGET:near
  7. extrn   IV_RMGET:near
  8. extrn   IV_PMSET:near
  9. extrn   IV_RMSET:near
  10. extrn   MBMALLOC:near
  11. extrn   SETRMSTUB:near
  12. extrn   SETPMSTUB:near
  13.  
  14. public  SETIRQ
  15.  
  16. _TEXTseg
  17.  
  18. SETIRQ:
  19.         mov ecx,[esp+4+0+00h]
  20.         mov eax,[esp+4+0+0ch]
  21.         or eax,eax
  22.         jmp setirqtbl[ecx*4]
  23.  
  24. setirqc:
  25.         jnz short @@00
  26.  
  27.         push offset _lowheapblock
  28.         push IRQCLEN
  29.         call MBMALLOC
  30.         or eax,eax
  31.         jnz short @@00
  32.  
  33.         ret 1ch
  34.  
  35. @@00:
  36.         mov [esp+4+0+0ch],eax
  37.         mov ecx,eax
  38.         add ecx,_database
  39.         shl ecx,12
  40.         shr cx,12
  41.         mov [esp+4+0+08h],ecx
  42.  
  43.         mov ecx,[esp+4+0+04h]
  44.         push eax
  45.         push ecx
  46.         push RMSTUBINRC
  47.  
  48.         add eax,RMSTUBNRLEN
  49.         mov ecx,eax
  50.         add ecx,_code_data
  51.         xchg ecx,[esp+12+4+0+04h]
  52.  
  53.         push eax
  54.         push ecx
  55.         call SETPMSTUB
  56.  
  57.         call SETRMSTUB
  58.  
  59.         jmp short setirq
  60.  
  61. setirqi:
  62.         jnz short @@00
  63.  
  64.         push offset _lowheapblock
  65.         push IRQILEN
  66.         call MBMALLOC
  67.         or eax,eax
  68.         jnz short @@00
  69.  
  70.         ret 1ch
  71.  
  72. @@00:
  73.         mov [esp+4+0+0ch],eax
  74.         mov ecx,eax
  75.         add ecx,_database
  76.         shl ecx,12
  77.         shr cx,12
  78.         mov [esp+4+0+08h],ecx
  79.  
  80.         mov ecx,[esp+4+0+04h]
  81.         push eax
  82.         push ecx
  83.         push RMSTUBINRI
  84.         call SETRMSTUB
  85.  
  86.         jmp short setirq
  87.  
  88. setirqown:
  89.         mov dword ptr [esp+4+0+0ch],TRUE
  90.  
  91. setirq:
  92.         push ebx
  93.         mov ax,900h
  94.         int 31h
  95.         push eax
  96.  
  97.         mov ebx,[esp+4+8+18h]
  98.         mov eax,ebx
  99.         shr ebx,3
  100.         mov bl,_PICtable[ebx]
  101.         and al,7
  102.         add bl,al
  103.  
  104.         mov eax,[esp+4+8+14h]
  105.         push ebx
  106.         push eax
  107.         call IV_RMGET
  108.  
  109.         mov eax,[esp+4+8+10h]
  110.         push ebx
  111.         push eax
  112.         call IV_PMGET
  113.  
  114.         xor eax,eax
  115.         push ebx
  116.         mov ax,[esp+4+4+8+08h]
  117.         push eax
  118.         mov ax,[esp+8+4+8+08h+2]
  119.         push eax
  120.         call IV_RMSET
  121.  
  122.         push ebx
  123.         mov eax,[esp+4+4+8+04h]
  124.         push eax
  125.         push cs
  126.         call IV_PMSET
  127.  
  128.         pop eax
  129.         int 31h
  130.         pop ebx
  131.         mov eax,[esp+4+0+0ch]
  132.         ret 1ch
  133.  
  134. ends
  135.  
  136. _DATAseg
  137.  
  138. setirqtbl       dd      setirqi,setirqc,setirqown
  139.  
  140. ends
  141. end
  142.  
  143.