home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-ASM_VI.ARJ / PROGASM.ZIP / PROG006.ASM < prev    next >
Assembly Source File  |  1988-04-10  |  789b  |  22 lines

  1.  
  2. ;************************************************************************
  3. ; Read_Register                                                         *
  4. ; Read a value from a register                                          *
  5. ; Entry:        Register - Port to read value from                      *
  6. ; Exit:         AX       - Value read in                                *
  7. ;************************************************************************
  8.  
  9. Register        EQU     [BP+4]
  10.  
  11.         PUBLIC  _Read_Register
  12.  
  13. _Read_Register  PROC NEAR
  14.         PUSH    BP
  15.         MOV     BP,SP
  16.         MOV     DX,Register             ;Fetch register address
  17.         IN      AL,DX                   ;Read value
  18.         XOR     AH,AH
  19.         POP     BP
  20.         RET
  21. _Read_Register  ENDP
  22.