Jump to content

in and out instructions

- - - - -

  • Please log in to reply
1 reply to this topic

#1
innerLOL

innerLOL

    Newbie

  • Members
  • PipPip
  • 29 posts
soon i would like to learn how to write hardware drivers, and im just wondering, what exactly is passed in imm/dx of in/out instructions?

port number?
what does it mean?

its like:

usb0 - 0
usb1 - 1
pci - 2
pci-e - 3
agp - 4
sata1 - 5
sata 2 - 6

??
or what?

#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Definitely not that simple. Here's an example of programming the keyboard controller with IO ports.
The IN/OUT instructions in Intel assembly language (I'm assuming that's what you're using) uses DL or DX to determine the port to send data out on, and AL or AX to hold the data to send. This information is sent to the I/O controller which reroutes the data bytes (i.e. the stuff in AL or AX) to the proper device.

Here's a comprehensive list of port numbers and their associated devices.

Edited by dargueta, 28 December 2009 - 07:23 AM.
Added link

sudo rm -rf /




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users