How to understand this assembly instruction?

Status
Not open for further replies.

ubuntu_amateur

Member level 4
Joined
Sep 24, 2006
Messages
71
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,665
inl instruction asm

there is several instructions in assembly language:
Code:
	movw	$0xcf8,%dx
	movl	$0x80003840,%eax	#
	outl	%eax,%dx
	movb	$0xfc,%dl
	inl	%dx,%eax

how to understand the last instruction? what means "inl"?
could anyone provide the material on assembly instruction set?

Thanks a lot!
 

You didn't say the CPU type or assembler version, but the b/w/l opcode suffix usually means byte/word/long, which usually means 8/16/32 bit operand. So, "inl" probably means "input from 32 bit port".
 

to ease understanding the code, I'll just comment it rightaway.

Code:
   movw   $0xcf8,%dx              ; dx = PCI address port (this is x86 architecture)
   movl   $0x80003840,%eax    ; eax = address of register 40h, function 0, device 7h, at bus 0
   outl   %eax,%dx                  ; "tell" the PCI device that we want to access register 40h in the next PCI cycle
   movb   $0xfc,%dl                 ; dx = 0xCFC = PCI data port (in x86 architecture)
   inl   %dx,%eax                    ; eax = dword starting at register 40h in the PCI device

This should be clear enough for you .

PS: The assembly language syntax is in AT&T syntax and it's an x86 (IBM-PC) architecture code. Look for AT&T syntax tutorial if you feel confused. IIRC, GAS (GNU Assembler) tutorial would be enough.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…