how do you use IN and OUT??

im interested in port 3f8 (serial port)?
Posted on 2004-12-12 17:24:00 by Retsim_X
Retsim_X,

Those two instructions are not available to you in normal 32 bit protected mode Windows. You can either use them from 16 bit DOS code or write an OS specific device driver.
Posted on 2004-12-12 17:39:00 by hutch--
Retsim_X,

If you are required to use Windows, you should at least try the code we suggested to you:

CreateFile
ReadFile
WriteFile

They work, and can probably do everything you need to do. If you try and have questions, you will find help! Here, or at the MASM32 Forum.

Try it! It works and does not require special drivers or using restricted opcodes.

farrier
Posted on 2004-12-12 17:59:27 by farrier
i spent 3 an a half hours mucking around with the instructions an got them to work UNDER WINDOWS PROGRAMMED IN MASM32 DLGAPP, i can read all the ports in my old toshiba 486DX2 (it takes like 70s to do a assemble and link) :lol:

hutch are you sure ya cant get them to work in win???
i wrote a windowless key logger too. it reads the keybuf port 60h FINE

mind you i got some bsd's (blue screen of death) when working with the dma ports, some vmdvxd???
Posted on 2004-12-13 03:17:40 by Retsim_X
You're on windows 9x then, which allows you to do a lot of dirty things. Port I/O == nonworking application under NT.

If you want to deal with the serial port, you really should use the win32 API for it, as it'll work on both 9x and NT.

If you insist on direct port I/O there's a couple of ways to do it under NT - writing your own driver, using opcode's KMD, etc... http://www.asmcommunity.net/board/viewtopic.php?t=18859
Posted on 2004-12-13 03:22:18 by f0dder
Retsim_X,

Early OEM versions of win95 allowed you to still write to some ports directly as they were early hybrids from DOS but later win9x version did not and any of the NT/2k/XP version never did allow direct port access.

Without writing a device driver, Farrier's suggestion is probably the best way to go and its reliable across different windows versions.
Posted on 2004-12-13 04:11:08 by hutch--
Retsim_X,

If you are required to use Windows, you should at least try the code we suggested to you:

CreateFile
ReadFile
WriteFile

They work, and can probably do everything you need to do. If you try and have questions, you will find help! Here, or at the MASM32 Forum.

Try it! It works and does not require special drivers or using restricted opcodes.

farrier


do you have a link on how to use this api's for serial communication?
Posted on 2004-12-13 09:29:49 by Scorpie
It is all in the msdn...
Posted on 2004-12-13 11:47:39 by roticv
Look up Platform SDK: Device I/O (located under Windows Development -> Windows Base Services -> Device I/O). Quoting the overview:


A process uses the CreateFile function to open a handle to a communications resource. For example, specifying COM1 opens a handle to a serial port, and LPT1 opens a handle to a parallel port.


If you want a quick entrance point, look up SetupComm.
Posted on 2004-12-13 12:12:21 by f0dder
i got a xp desktop computer and i just tryed running my progie on it and it works FINE

i dont understand how it cant work
Posted on 2004-12-13 16:27:29 by Retsim_X
You're using IN and OUT in a win32 (and not dos) application and it works without errors on XP? That sounds strange... could you mail the exe to me? (use `f0dder AT yahoo DOT com')
Posted on 2004-12-13 16:31:50 by f0dder
f0dder

i just sent ya email

tell us if the attachment is buggered
Posted on 2004-12-13 17:13:36 by Retsim_X
I don't see how this could work on any NT-based OS... tested it on my box (XP SP2 professional, from administrative account), and as expected I get a program error when I try reading ports (tried 60, 64 and 3f8).
Posted on 2004-12-14 10:41:48 by f0dder
I wrote it to write some singals from unkown mchips connecting it to pport to dump them in file for further analysis.
You just need to change ReadPort proc in portsio.asm file to whatever in out with ports you want, and change in givio.bat source:


; I/O access to 379h,37Ah ports
mov ecx, pIopm
mov eax,379h
btr dword ptr [ecx],eax
inc eax ;37Ah
btr dword ptr [ecx],eax


to ports numbers you want.
It mostly based on F-Four example drivers.
Four-F wrote great tuts and unic KMD kit.
I'd recommend you obtain it and learn.


Hmmm... I wanted to attach source but I don't see how to do it : /
Has "attach file" service gone forever, or I just can not see it?
Posted on 2004-12-14 19:11:11 by The Svin
Svin, uploads have been disabled due to security issues (hacked board) .
Posted on 2004-12-14 20:19:35 by f0dder