home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / btree / mulkey / mulget2.asm < prev    next >
Encoding:
Assembly Source File  |  1988-04-05  |  2.1 KB  |  75 lines

  1. ; Assembler interface to Turbo Pascal - MULKEY
  2. ;
  3. ; Copyright 1988 by Mark R. Boler  -  All Rights Reserved
  4.  
  5. TITLE      MULKEY
  6.  
  7. CODE       SEGMENT BYTE PUBLIC
  8.  
  9.            ASSUME  CS:CODE
  10.  
  11.            EXTRN   RPN_Record: NEAR
  12.  
  13.            PUBLIC  GetEqual, GetGreater, GetLessThan
  14.            PUBLIC  GetGreaterOrEqual, GetLessThanOrEqual
  15.  
  16. ; WARNING: This is NOT structured code.  It is not intended to be
  17. ;          easily read or understood.  It is intended to be small.
  18.  
  19. GetEqualOp           EQU 5
  20. GetGreaterOp         EQU 8
  21. GetGreaterOrEqualOp  EQU 9
  22. GetLessThanOp        EQU 10
  23. GetLessThanOrEqualOp EQU 11
  24.  
  25. ; PROCEDURE Getxxxx(Handle: WORD;
  26. ;                   KeyNum: WORD;
  27. ;                    VAR k;
  28. ;                    VAR d);
  29.  
  30. Handle     EQU     WORD  PTR ss:[bx + 14]
  31. KeyNum     EQU     WORD  PTR ss:[bx + 12]
  32. KBufSeg    EQU     WORD  PTR ss:[bx + 10]
  33. KBufOfs    EQU     WORD  PTR ss:[bx + 8]
  34. DBufSeg    EQU     WORD  PTR ss:[bx + 6]
  35. DBufOfs    EQU     WORD  PTR ss:[bx + 4]
  36.  
  37. GetGreater PROC    FAR
  38.            mov     al, GetEqualOp
  39. CallEntry:
  40.            mov     bx, sp                 ; set up stack frame in bx
  41.            push    Handle                 ; set up for call to RPN_Record
  42.            push    KeyNum
  43.            push    KBufSeg
  44.            push    KBufOfs
  45.            push    DBufSeg
  46.            push    DBufOfs
  47.            push    ax
  48.            call    RPN_Record             ; make the call
  49.            ret     12                     ; clean up and return to caller
  50. GetGreater ENDP
  51.  
  52. GetEqual   PROC    FAR
  53.            mov     al, GetEqualOp         ; set op code
  54.            jmp     SHORT CallEntry        ; go set it
  55. GetEqual   ENDP
  56.  
  57. GetLessThan PROC   FAR
  58.            mov     al, GetLessThanOp      ; set op code
  59.            jmp     SHORT CallEntry        ; go set it
  60. GetLessThan ENDP
  61.  
  62. GetGreaterOrEqual  PROC FAR
  63.            mov     al, GetGreaterOrEqualOp
  64.            jmp     SHORT CallEntry
  65. GetGreaterOrEqual  ENDP
  66.  
  67. GetLessThanOrEqual PROC FAR
  68.            mov     al, GetLessThanOrEqualOp
  69.            jmp     SHORT CallEntry
  70. GetLessThanOrEqual ENDP
  71.  
  72. CODE       ENDS
  73.  
  74.            END
  75.