home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c081_11 / 9.ddi / CHAPXMPL.ZIP / ASMPROC.ASM < prev    next >
Encoding:
Assembly Source File  |  1991-02-13  |  1.0 KB  |  33 lines

  1. ; Turbo Assembler    Copyright (c) 1988, 1991 By Borland International, Inc.
  2.  
  3. ; ASMPROC.ASM
  4. ; Calls pascal routines in SAMPLE.PAS.
  5.  
  6. ; From the Turbo Assembler User's Guide - Interfacing Turbo Assembler
  7. ;                                          with Turbo Pascal
  8.  
  9. DATA     SEGMENT WORD PUBLIC
  10.          ASSUME DS:DATA
  11.          EXTRN  A:WORD             ;variable from the unit
  12. DATA     ENDS
  13.  
  14.  
  15. CODE     SEGMENT BYTE PUBLIC
  16.          ASSUME CS:CODE
  17.          EXTRN  PublicProc : FAR   ;far procedure (exported by the unit)
  18.          EXTRN  NearProc : NEAR    ;near procedure (local to unit)
  19.          EXTRN  FarProc  : FAR     ;far procedure (local but forced far)
  20.  
  21. AsmProc  PROC NEAR
  22.          PUBLIC AsmProc
  23.          CALL   FAR PTR PublicProc
  24.          CALL   NearProc
  25.          CALL   FAR PTR FarProc
  26.          mov    cx,ds:A            ;pull in variable A from the unit
  27.          sub    cx,2               ;do something to change it
  28.          mov    ds:A,cx            ;store it back
  29.          RET
  30. AsmProc  ENDP
  31. CODE     ENDS
  32.          END
  33.