home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pcmagazi / 1992 / 11 / labnotes / varseg.asm < prev    next >
Assembly Source File  |  1992-02-24  |  2KB  |  74 lines

  1. ;VarSeg.ASM
  2. ;Copyright (c) 1992 Jay Munro
  3. ;First Published in PC Magazine June 16, 1992 
  4. ;----------------------------------------------------------------------------
  5. ;Varseg - Returns segment selector of numeric variable, array or type.
  6. ;Varptr - Returns address of numeric variable, array or type
  7. ;Seg - Return long pointer to numeric variable, array or type.
  8. ;SSeg - Returns string segment of a variable length string.
  9. ;Sadd - Returns string address of a variable length string.
  10.  
  11. ;syntax
  12. ;  Declare Function VarSeg% Lib "LabNotes.DLL" (Variable as any)
  13. ;  Declare Function VarPtr% Lib "LabNotes.DLL" (Variable as any)
  14. ;  Declare Function Seg& Lib "LabNotes.DLL" (Variable as any)
  15. ;  Declare Function SSeg% Lib "LabNotes.DLL" (StringVariable$)
  16. ;  Declare Function Sadd% Lib "LabNotes.DLL" (StringVariable$)
  17. ;----------------------------------------------------------------------------
  18.  
  19. ;*** Note ***
  20. ; Seg is aliased from LSeg in Labnotes.DEF
  21.  
  22. .286P
  23. .Model Medium
  24.   Public VarSeg,VarPtr, SSeg, Sadd, LSeg
  25.   Include Labnotes.Inc
  26.   Extrn VBDeRefHlStr:Proc
  27.   
  28. .Code
  29.  
  30.   SSeg Proc Far
  31.      WinProlog
  32.      Lds  AX,[BP+6]
  33.      Push DS
  34.      Push AX
  35.      Call VBDeRefHlStr
  36.      Xchg DX,AX
  37.      WinEpilog
  38.      Ret 4
  39.   SSeg EndP
  40.   
  41.   Sadd Proc Far
  42.      WinProlog
  43.      Lds  AX, [BP+6]
  44.      Push DS
  45.      Push AX
  46.      Call VBDeRefHlStr
  47.      WinEpilog
  48.      Ret 4
  49.   Sadd EndP
  50.  
  51.   VarPtr Proc Far
  52.      ShortWinProlog
  53.      Mov AX, [BP+6]
  54.      ShortWinEpilog
  55.      Ret 4
  56.   VarPtr EndP
  57.   
  58.   VarSeg Proc Far
  59.      ShortWinProlog
  60.      Mov AX, [BP+8]
  61.      ShortWinEpilog
  62.      Ret 4
  63.   VarSeg EndP
  64.  
  65.   LSeg Proc Far
  66.      ShortWinProlog
  67.      Mov AX, [BP+6]
  68.      Mov DX, [BP+8]
  69.      ShortWinEpilog
  70.      Ret 4
  71.   LSeg EndP
  72.  
  73. End
  74.