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

  1. ;OutInp.ASM
  2. ;Copyright (c) 1992 Jay Munro
  3. ;First Published in PC Magazine June 16,1992
  4. ;----------------------------------------------------------------------------
  5. ;Out and Inp keyword replacements for Visual Basic.
  6. ;Syntax:
  7. ;  Declare Function Inp Lib "LabNotes.DLL" (Byval Port%)
  8. ;  Declare Sub Out Lib "LabNotes.DLL" (Byval Port%,Byval Value%)
  9. ;----------------------------------------------------------------------------
  10.  
  11. ;Note, VBOut will be aliased in .DEF file
  12.  
  13. .286
  14. .Model Medium
  15.   Public  VBOut, Inp
  16.   Include LabNotes.Inc
  17.   
  18. .Code
  19.  
  20. VBOut Proc Far
  21.    ShortWinProlog                       ;use short form prolog, no DS
  22.    Mov AL,[BP+6]                        ;get data to output
  23.    Mov DX,[BP+8]                        ;get port to send to
  24.    Out DX,AL                            ;do it
  25.    ShortWinEpilog
  26.    Ret 4                                ;return clearing stack
  27. VBOut EndP
  28.  
  29.  
  30. Inp Proc Far 
  31.    ShortWinProlog                       ;use short form, no DS
  32.    Mov DX,[BP+6]                        ;get port to read
  33.    In AL,DX                             ;read one byte
  34.    Xor  AH,AH                           ;clear high byte
  35.    ShortWinEpilog
  36.    Ret 2                                ;return clearing the stack
  37. Inp EndP
  38.  
  39. End
  40.