home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / turbopas / procparm.zip / PROCPARM.ASM next >
Assembly Source File  |  1986-05-09  |  1KB  |  46 lines

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