NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: nobody on December 18, 2008, 07:44:20 PM
-
I write a simple code to read a port with the in instruction but when i run the program the in al, dx create a segmentation fault.
I find that to use in or out instruction in linux i first need permission but i don't know how?
The code:
global _start
section .data
section .text
_start:
mov dx, 03f8h
in al, dx
xor ebx, ebx ; send 0 as 'exit code'
mov eax, 1 ; terminate process
int 80h ; execute the syscall
-
I think you should use a1 (that's a one) instead of al (that's an L).
-
What effect do you get by replacing "al", a register name, with "a1", an undefined symbol??? Won't assemble for me. :(
Try sys_ioperm.
Best,
Frank