Page 1 of 1

Posted: Mon Nov 25, 2002 2:09 pm
by BackupUser
Restored from previous forum. Originally posted by stefhan.

Hello,

I would like to know how to access directly to parallel port.
For robotic applications, I must read/write specifics bits
on this port.
Some help will be appreciate.

Posted: Mon Nov 25, 2002 4:30 pm
by BackupUser
Restored from previous forum. Originally posted by Rings.

look at this topic:

viewtopic.php?t=2549

there was handling with hardwareports.....


Its a long way to the top if you wanna .....CodeGuru

Posted: Mon Nov 25, 2002 5:27 pm
by BackupUser
Restored from previous forum. Originally posted by stefhan.

Thanks for your reponse

But under linux, using dll will be hardest !
I need parallel port access via windows and linux(robot).
Doesn't try demo of pure basic under linux, but if inline asm
supported may be a direct access should be done:

* write on datas port:
MOV DX,378h
MOV AX, My_Value
OUT DX,AX

* Read on state port:
MOV DX,379h
IN DX
MOV My_Value,AX

I'm going to try...

Posted: Wed Nov 27, 2002 9:35 am
by BackupUser
Restored from previous forum. Originally posted by stefhan.

Don't work :-((

mov dx,889
in dx
mov my_value,ax

PureBasic said on compilation: "Assembly error ! Please mail us this file"

"in" instruction doesn't work ?
I need some help & docs on assembler under purebasic !
Thx

Posted: Wed Nov 27, 2002 10:47 am
by BackupUser
Restored from previous forum. Originally posted by El_Choni.

Try:

Code: Select all

my_value.w
mov dx, 889
in ax, dx
mov my_value, ax
Bye,

PS: about inline Asm in PureBasic, it uses Nasm's syntax, but from what I've read lately, it will use Fasm in the next version.

Posted: Wed Nov 27, 2002 1:40 pm
by BackupUser
Restored from previous forum. Originally posted by stefhan.

Working ! But not under win2000/xp :-(

Win2000/xp denied direct access on ports (in/out instructions).
Don't know how to force access under win2000/xp

Thank you.

Posted: Wed Nov 27, 2002 2:57 pm
by BackupUser
Restored from previous forum. Originally posted by freak.

Why don't you use the dll for windows, and the inline Asm stuff only on Linux?

Like this:

Code: Select all

CompilerIf #OS = #Linux
  ;
  ; inline Asm Method
  ;
CompilerElse
  ;
  ; Dll Method
  ;
CompilerEndIf
Now, if compiled for Linux, the Asm stuff is used, and if compiled for Windows, the dll is used.

Timo

Posted: Wed Nov 27, 2002 5:07 pm
by BackupUser
Restored from previous forum. Originally posted by Berikco.

Direct hardware access not possible under NT-2K-XP
The OS does not allow this.
You need a device driver to do this, because this is running in another layer then normal apps.



Regards,

Berikco

http://www.benny.zeb.be

Posted: Wed Nov 27, 2002 7:28 pm
by BackupUser
Restored from previous forum. Originally posted by El_Choni.

I think there's a WINIO.DLL somewhere to do this under WinXP. Saw some info on how to use it in the Win32asm message board:

http://board.win32asmcommunity.net

Bye,

El_Choni

Posted: Wed Nov 27, 2002 8:02 pm
by BackupUser
Restored from previous forum. Originally posted by freak.

Yes, and in the Link, Rings posted above, there's a link to
a DLL import from Danilo. It's http://home.t-online.de/home/ExpressTrack/PB_WinIO.zip

Timo