home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / PROCPARM.ZIP / PROCPARM.ASM next >
Encoding:
Assembly Source File  |  1986-08-24  |  1.4 KB  |  47 lines

  1.  
  2. ;                         Version 2.1             86/05/09
  3. ;
  4. ;  Author: Mike Babulic   (Compuserve 72307,314, Fido 314/1)
  5. ;
  6. ;
  7. ;  This is the source for ProcParm.BIN
  8. ;  I actually used DEBUG to assemble it
  9. ;
  10. ;           for NEAR dummy procedures
  11. ;
  12.         ORG  0
  13. ;
  14. NEAR:   POP  AX            ; Ret Address
  15.         POP  BX            ; Proc Ptr
  16.         PUSH AX
  17.         JMP  BX            ; Jump to Proc
  18. ;
  19. ;           for FAR dummy procedures
  20. ;
  21. FAR:    POP  AX            ; Ret Addr
  22.         POP  BX            ; Proc. Offset
  23.         POP  CX            ; Proc. Segment
  24.         PUSH CS            ; Push long return address onto stack
  25.         PUSH AX            ;
  26.         PUSH CX            ; Jump to Proc
  27.         PUSH BX
  28.         RETF
  29.  
  30. ;
  31. ;           for FAR procedures with Offset, NB. called within a TURBO procedure
  32. ;
  33. ;                procedure OffsetProc(p:FarProcPtr; Offset:integer);
  34. ;
  35. FAROFS: POP  AX            ; Ret Addr (throw away)
  36.         POP  BX            ; Sum Proc. offsets
  37.         POP  CX            ;
  38.         ADD  BX,CX         ;
  39.         POP  CX            ; Proc. Segment
  40.         MOV  SP,BP         ; Drop down one level
  41.         POP  BP            ;
  42.         POP  AX            ; Ret Addr of routine that called OffsetProc
  43.         PUSH CS            ; Push long return address onto stack
  44.         PUSH AX            ;
  45.         PUSH CX            ; Jump to Proc
  46.         PUSH BX
  47.         RETF