home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / PASCUTIL.ZIP / INSUB.ASM < prev    next >
Encoding:
Assembly Source File  |  1985-11-07  |  640 b   |  22 lines

  1. ; INSUB - subroutine to read machine port for Pascal programs
  2. ; INSUB(PORTNO,INVAL)
  3. ; PORTNO is the machine port number
  4. ; INVAL is the value (0-255) returned
  5. cseg segment para public 'code'
  6. public insub
  7. insub proc far
  8.     assume cs:cseg,ds:nothing,ss:nothing,es:nothing
  9.     push bp
  10.     mov bp,sp
  11.     mov si,[bp+8]    ; point to port
  12.     mov dx,[si]      ; load in dx
  13.     in al,dx         ; read port
  14.     mov si,[bp+6]    ; point to value
  15.     mov ah,0
  16.     mov [si],ax      ; save value
  17.     pop bp
  18.     ret 4
  19. insub endp
  20. cseg ends
  21.     end
  22.