Hi,
Postmann wrote:
Code:
mov ax, 32768
or al, [BUS]
shl eax, 16
mov ax, [DEV]
shl ax, 11
mov al, [FN]
or ah, al
mov al, [VEN_ID]
cli
mov dx, 0x0CF8
out dx, eax
mov dx, 0x0CFC
in eax, dx
mov [RESULT], eax
sti
No change though.
That should work, unless there's a bug somewhere else (not in the assembly itself). One possibility is that whichever compiler you're using doesn't know that you're accessing variables and keeps the values in registers (without updating the values in memory).
I'd recommend posting a disassembly of whatever the compiler generated.
Note that there is an unrelated bug (you shouldn't look at functions 1 to 7 unless the device says it is a multi-function device because if you do the information for "function 0" can be return for functions 1 to 7).
Also (for performance) you could do something like this:
Code:
for(uint32_t i = 0x80000000; i <= 0x80000000 | 255<<24 | 31<<11 | 7<<8 | 0; i += 1 << 8) {
asm {
mov eax,[i]
cli
mov dx, 0x0CF8
out dx, eax
mov dx, 0x0CFC
in eax, dx
mov [RESULT], eax
sti
}
Cheers,
Brendan