;================================================================================= ; sys_ioperm demonstration. ; ; Enables access to 0x378 (parallel port) and raises/lowers the current. ; (LED's are a nice way to test this. Connect anode to any of 2-9 pins and cathode ; to a ground pin (18-25)(1Kom resistor might be necessary). ; ; The LSCR Project. ;================================================================================= format ELF include '../macros.inc' include '../../include/symbols.inc' include '../../include/structs.inc' extrn error_chk section '.text' executable public _start _start: mov eax, SYS_IOPERM mov ebx, 0x378 mov ecx, 3 mov edx, 1 int 0x80 ccall error_chk, <"SYS_IOPERM has failed: ">, exit mov dx, 0x378 in al, dx xor al, 11111111b ; switch current state out dx, al mov eax, SYS_IOPERM ; this is not actually required, since Linux will disable mov ebx, edx ; the range anyway when the process terminates. mov ecx, 3 xor edx, edx int 0x80 exit: mov eax, SYS_EXIT xor ebx, ebx int 0x80