News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

masm32.. PARALLEL PORT;.

Started by randomnumber, October 09, 2009, 09:35:55 PM

Previous topic - Next topic

randomnumber

Does masm32 have specific commands for the parrallel,serial ports interface?.. on windows xp? if so how does it bypass the xp restriction on direct hardware access?.. .

Jimg

You will have to use a dll like inpout32 to access the parallel port.

farrier

randomnumber,

MASM32 doesn't have a special commands, but standard windows commands allow you to communicate with the serial and or parallel ports without having to use a non-standard dll.  See:

http://www.masm32.com/board/index.php?topic=1786.msg13827#msg13827

hth,

farrier
It is a GOOD day to code!
Some assembly required!
ASM me!
With every mistake, we must surely be learning. (George...Bush)

randomnumber

\jigm
i have tried the inpout32.dll but i think am doing some thing wrong. ps.. i tried out 16bit 1st..

includelib inpout16,'c:\windows\system32\inpout16.dll'
out16 proto :word,:byte

mov dx,0378h
mov al,48h
out16 dx,al


are these the only lines i need in the program? :eek


PBrennick

Have you played with KMD Kit?

Paul
The GeneSys Project is available from:
The Repository or My crappy website

randomnumber

NO.. but i have just down loaded the kmd tutorials.. wat do they involve in relation to my problem?

Jimg

I never tried 16-bit.
The 32 bit I tried used
    invoke Out32,0x378,ebx
and it worked for me.

How did your program fail?

randomnumber

the program doesn't change the registers or read them.. i don't know wats wrong... i have tried other programs "userport" which open the port like windows 98 but i don't lyk that..

i have seen that createfile and the comm... like commands are the 'real' new ways to interact with the ports...

does any one have an example code i can look at?

farrier

randomnumber,

Attached is a proc that works everyday on Win95 ME SP and Vista computers.  The variable SP2000 is set if a serial printer is being used, otherwise a parallel port is used.  This even works with a serial port adapter that plugs into a USB port on a notebook running XP.

If you look at the link in the link I provided above, this code looks just like the C code provided in the SDK.

http://msdn.microsoft.com/en-us/library/aa363201%28VS.85%29.aspx

hth,

farrier
It is a GOOD day to code!
Some assembly required!
ASM me!
With every mistake, we must surely be learning. (George...Bush)

Jimg

I don't do 16-bit, but my wild guess is some kind of segment register problem.

When you say it doesn't change the registers, I assume you are talking about the values at the port, not dx and al.

The only thing I ever used it for is to blink some led's attached to the end of a printer cable.  It worked, but I can't seem to find the program now.

It was based upon information found at http://www.winasm.net/forum/index.php?showtopic=2341

I'll try to find the cable and recreate the program later if I get a chance, I'm fighting a video card problem at the moment.


Jimg

#10
deleted

Jimg

#11
As usual, I spoke a bit too soon.  I took a short nap and realized what my problem was.

The attached project works for me.

I never use dll's, so there's probably a cleaner way to set up the out32 call.

randomnumber

thanks \jigm.. din't know you could use the comctls to load new dlls..  :thumbu

\farrier.. i think the method in your program is best and will try to implement it wen i don't have cats chasing me..