Author Topic: work whith parallel port in nasm for linux  (Read 12884 times)

nobody

  • Guest
work whith parallel port in nasm for linux
« on: October 27, 2004, 05:22:14 AM »
Hi,
I am a beginner, but I have a problem:
I want to send to parallel port a byte using nasm program, in linux, that:

segment .text
BITS 16
global _start
_start:
mov al,0ffh
mov dx,378h
out dx,al
nop
jmp _start

My program run, but To parallel port is same state
(040h).
Please, help me!

Or, can I work whith BIOS interrupts? (Better for me, but, how to do?) How can I use LRMI, how can I have LRMI, and where?

nobody

  • Guest
Re: work whith parallel port in nasm for linux
« Reply #1 on: September 28, 2006, 10:07:17 AM »
Hi!

I never heard about an interrupt what is to control parallel port, but you may get some useable information from Ralph Brown's interrupt list. (You surely will find it if you search for "Intlist" in google)
Another idea:
Have you tried to assemble your code with BITS 32? Programs under Linux should run in 32-bit protected mode and then it should work. If not, you should know the num of parallel port device and you can simply write on this with int 80h (maybe EAX=3 EBX=DevNum ECX=DataAddr EDX=DataLen or something like this).

Good Luck! :)

nobody

  • Guest
Re: work whith parallel port in nasm for linux
« Reply #2 on: September 28, 2006, 04:26:37 PM »
That's not quite right (and the original question was from 2004 - dunno why it never got answered). The interrupt we want is int 80h, as usual - sys_ioperm is 101, starting port in ebx, number of ports to enable in ecx, 1 (read) or 3 (read/write) in edx seems to work. Then we can use the ports just like dos. (sys_iopl for ports over 3FFh)

Definitely lose the "bits 16"! LMRI can be found right here on SourceForge. RBIL at http://pobox.com/~ralf - it's his "ports.lst" that will be most useful for this.

Best,
Frank