home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / OS2HIST.ZIP / HISTASM.ASM next >
Assembly Source File  |  1988-02-18  |  2KB  |  122 lines

  1.         page    ,132
  2.         .286p
  3.         title    DOSEDIT assembly language portion
  4.  
  5.         include os2defs.ash
  6.  
  7.         .model large
  8.  
  9.         .code
  10.  
  11. ;        include    debugit.h
  12.  
  13. ; ***********************************************************************
  14. ; *                                      *
  15. ; *  EDITDISPATCH - DOSEDIT keyboard dispatcher                *
  16. ; *  this will be hooked into the keyboard subsystem via a         *
  17. ; *  KBDREGISTER call.                            *
  18. ; *                                      *
  19. ; *  The stack will have additional args pushed:            *
  20. ; *          PUSH (args for original call)                *
  21. ; *          CALL FunctionToIntercept                *
  22. ; *          PUSH Index                        *
  23. ; *          CALL (kbd router return addr here)            *
  24. ; *          PUSH DS (caller's DS)                    *
  25. ; *          CALL FAR (this routine)                    *
  26. ; *                                      *
  27. ; ***********************************************************************
  28.  
  29.  
  30. ed_retaddr    equ    2
  31. ed_callds    equ    6
  32. ed_nearptr    equ    8
  33. ed_index    equ    10
  34. ed_farret    equ    12
  35. ed_kbdhandle    equ    16
  36. ed_iowait    equ    18
  37. ed_length1    equ    20
  38. ed_length2    equ    22
  39. ed_buffer1    equ    24
  40. ed_buffer2    equ    26
  41.  
  42.  
  43.         extrn    editstringin:far
  44.  
  45.         public    EDITDISPATCH
  46. EDITDISPATCH    proc    far
  47.  
  48.         push    bp
  49.         mov    bp,sp
  50.  
  51. ; only 1 function will be registered, so....
  52.  
  53.         push    bx
  54.         push    cx
  55.         push    dx
  56.         push    si
  57.         push    di            ; save general registers
  58.  
  59.         push    [bp].ed_buffer2
  60.         push    [bp].ed_buffer1
  61.         push    [bp].ed_length2
  62.         push    [bp].ed_length1
  63.         push    [bp].ed_iowait
  64.         push    [bp].ed_kbdhandle
  65.         call    editstringin
  66.  
  67.         pop    di            ; restore general regs
  68.         pop    si
  69.         pop    dx
  70.         pop    cx
  71.         pop    bx
  72.  
  73.         pop    bp
  74.         ret    
  75.  
  76.  
  77. EDITDISPATCH    endp
  78.  
  79.  
  80.  
  81.         extrn    addmacro:far
  82.  
  83.         public    EDITADDMAC
  84. EDITADDMAC    proc    far
  85.  
  86.         push    bp
  87.         mov    bp,sp
  88.  
  89. ; only 1 function will be registered, so....
  90.  
  91.         push    bx
  92.         push    cx
  93.         push    dx
  94.         push    si
  95.         push    di            ; save general registers
  96.  
  97.         push    [bp+12]
  98.         push    [bp+10]
  99.         push    [bp+8]
  100.         push    [bp+6]
  101.         call    addmacro
  102.  
  103.         pop    di            ; restore general regs
  104.         pop    si
  105.         pop    dx
  106.         pop    cx
  107.         pop    bx
  108.  
  109.         pop    bp
  110.         ret    8
  111.  
  112. EDITADDMAC    endp
  113.  
  114.         .data
  115.  
  116.         public    __acrtused
  117. __acrtused    dw    0
  118.  
  119.  
  120.         end
  121.  
  122.