home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cdisk.zip / STARTUP / STARTINT.ASM < prev   
Assembly Source File  |  1992-07-06  |  1KB  |  71 lines

  1. ;    
  2. ;    C startup routine, one device, w/interrupt and timer
  3. ;
  4.     PUBLIC  _STRAT
  5.     PUBLIC  __acrtused
  6.     PUBLIC  _INT_HNDLR
  7.     PUBLIC  _TIM_HNDLR
  8.  
  9.     EXTRN   _interrupt_handler:near
  10.     EXTRN   _timer_handler:near
  11.     EXTRN   _main:near
  12.  
  13. _DATA    segment   word public 'DATA'
  14. _DATA    ends
  15.  
  16. CONST    segment   word public 'CONST'
  17. CONST    ends
  18.  
  19. _BSS    segment word public 'BSS'
  20. _BSS    ends
  21.  
  22. DGROUP    group     CONST, _BSS, _DATA
  23.  
  24. _TEXT    segment   word public 'CODE'
  25.  
  26.     assume cs:_TEXT,ds:DGROUP,es:NOTHING, ss:NOTHING
  27.     .286P
  28. ;
  29. _STRAT    proc    far
  30. __acrtused:            ; no startup code
  31. ;
  32.     push    0
  33.     jmp    start        ; signal device 0
  34. ;
  35. start:
  36.     push    es        ;send Request Packet address
  37.     push    bx
  38.     call    _main        ;call driver mainline
  39.     pop    bx        ;restore es:bx
  40.     pop    es
  41.     add    sp,2        ;clean up stack
  42.     mov    word ptr es:[bx+3],ax ;send completion status
  43.     ret
  44. ;
  45. _STRAT    endp
  46. ;
  47. _INT_HNDLR proc    far
  48. ;
  49.     call    _interrupt_handler ;handle rupts
  50.     ret            ;bail out
  51. ;
  52. _INT_HNDLR    endp
  53. ;
  54. _TIM_HNDLR    proc    far
  55. ;
  56.     pusha
  57.     push    es
  58.     push    ds
  59.     call    _timer_handler
  60.     pop    ds
  61.     pop    es
  62.     popa
  63.     ret
  64. ;
  65. _TIM_HNDLR     endp
  66. ;
  67. _TEXT    ends
  68.            end
  69.  
  70.  
  71.