joy merwin monteiro wrote:
> 
> Hi,
> 
> I had been here before, I can't figure out why the code isnt working.

Seems like everybody's got a different idea what's wrong...
I might as well throw in my wild guess, too :)

> global _start
> 
> port equ 378h
> stat equ port+1
> ctrl equ port+2
> 
> section .text
> _start:
> 
>     mov eax,101
>     mov ebx,port
>     mov ecx,3

This is the number of ports you're enabling, right?

>     mov edx,port

And this should be the "turn-on" value... I imagine you want
"3" here, too, for "in" and "out" permissions...

>     int 80h

Check the returned value here, as Richard says, if signed,
bail out.

>     mov dx,port
>     mov al,0xff
>     out 378h,al  <----- segfault here

"out dx, al", as Jan suggests...

>     mov eax,1
>     int 0x80
> 
> Any help/ pointers?

Odd that it should work on a different distro... If you
suspect ld, grab newer binutils... Different permissions
setup would be more likely, I would think... But check that
return value - it should tell the tale. (assume you know
that -ERRNO is in eax, not -1 and ERRNO in errno, as man 2
says...)

Best,
Frank
-
To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to