Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to understand this assembly instruction?

Status
Not open for further replies.

ubuntu_amateur

Member level 4
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 :D.

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top