News:

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

WinIo import library and include file

Started by MichaelW, February 12, 2006, 02:52:02 AM

Previous topic - Next topic

MichaelW

The attachment contains an include file and import library for WinIo, along with a batch file to build the import library and a test app. To actually run the test app you will need WinIo:

http://www.internals.com/

Update:

The WinIo32.zip attachment contains an include file and import library for the 32-bit components of WinIo Version 3.0, along with a batch file to build the import library and a simple test app.

Note that version 2 is still available, but the only link I found for it is in WinIO.chm under Introduction.


[attachment deleted by admin]
eschew obfuscation

Mark Jones

"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

IAO

Hi to all:    My English is poor. But I try.

I unloaded winiolib.zip. But when attempt to compile I have errors.
I have ServPack2.
I dealt with ml /c /coff test.asm and link sub.. test.obj
But it says to me: Error inkey.

If I comment it, it compiles but it does not do anything.
;inkey "Press any key to exit..."

The file test.exe works well.(The original post by Mr. MichaelW.)

Some person to tried to compile test.asm?
I have the archives: Winio.VXD, SYS and DLL.
Something I am making bad but I do not see it.

Thanks for your patience.

Bye ('_').
"There is no way to peace. Peace is the way."    Mahatma Gandhi

MichaelW

Hi IAO,

inkey is a macro the I think first appeared in the version of MACROS.ASM that has this date near the top of the file:

Updated 30th October 2005

If the version you have is older, then you can update your MASM32 installation ( here), or you can use the older input macro:

mov  eax, input(13,10,"Press enter to exit...")

eschew obfuscation

IAO

Hi to all:    My English is poor. But I try.

My lord MichaelW:
I have Win98 and WinXP.
I reinstalled yesterday Masm32. (W98 - WXP)

No errors. -- mmm -- But the program doesn't make anything.

My problem was in the long of the path.
C:\Respaldo\Asembler\Varios revisar\WEB-Asm-DLL-LPT\1LPT-Port-Files\1NT-LPT-Prog\1Winio\1WinIoLib  <------ "A DIABOLICAL PATH".
I think that Masm32 became crazy, with so enormous PATH.

I am a pig Latin speaker. (This expression gives me a lot of  laugh ).
I am Pinky cartoon, my dear friend.
Tonight, I will try to conquer the  world (WinIoLib).

If you laugh at my stupidities, it is enough for me.
If we laugh, we heal the soul. We oxygenate our bodies.

I am only transmitting you my observations.
Other people could have difficulties.

I hope my comment doesn't offend you.
I hope you have a nice day. God blesses you.

Thanks for your patience.
Bye ('_').
"There is no way to peace. Peace is the way."    Mahatma Gandhi

MichaelW


C:\Respaldo\Asembler\Varios revisar\WEB-Asm-DLL-LPT\1LPT-Port-Files\1NT-LPT-Prog\1Winio\1WinIoLib

The problem is probably not the length of the path, but the space between Varios and revisar. If you are building with a batch file you should be able to solve the problem by enclosing the path in double quotes ("the path"). If you are building in QE, without creating and running a makeit.bat, then the only solutions are to remove the space or replace it with some other character.


eschew obfuscation

Mark Jones

Here's a derrivative of the above code which (should) return the number of LPT ports detected by the BIOS. Seems to work on my XP box, but your results may vary. :bg


    invoke MapPhysToLin,400h,256,ADDR hPhysMem
    mov ebx,eax

    mov al,BYTE PTR[ebx+17]      ; Get BIOS printer count
    and al,11000000y             ; only interested in top two bits
    rol al,2                     ; al now = n printer ports detected (0-3)

    invoke UnmapPhysicalMemory,hPhysMem,ebx


Curious, in the article at ftp://ftp.armory.com/pub/user/rstevew/LPT/xPS2lpt2.BiD RSW states that the PS/2 has a "Programmable Option Select" mode which locks out bidirectional parallel mode by default. I'm curious if anyone knows, was that JUST for the original PS/2, or do incarnations of this crap still haunt PC's today?

Also that article shows code which enables bi-di mode on these PC's, but it's written in Basic. I translated it literally to assembler, but was curious if this is even close to correct, because admittedly MapPhysToLin is somewhat greek to me... would I need to map 94h and 102h to linear to access them, and is it even possible to write values back to that?


To toggle the PS/2's Programmable Option Select, do something like:
    mov al,BYTE PTR [94h]      ; change enable register
    and al,01111111y           ; disable locked bit
    mov BYTE PTR [94h],al      ; write it

    mov cl,BYTE PTR [102h]     ; POS register
;    and cl,01111111y           ; allow bidirectional OR
;    or cl,10000000y            ; disallow bidirectional
    mov BYTE PTR [102h],cl     ; write it

    mov al,BYTE PTR [94h]      ;
    or al,10000000y            ; re-enable locked bit
    mov BYTE PTR [94h],al      ;
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

MichaelW

AFAIK the only part of the PS/2 Programmable Option Select that is still functional in the typical PC is System Control Port A (I/O port 92h), used for controlling the A20 address line and doing a fast reset of the system under program control.

In the linked article, "tristate the output" is not a very precise description. In normal operation data written to the port is latched, and a read of the port reads the contents of the latch. For bi-directional operation the latch must be disabled so a read of the port can read the data presented to the connector.
eschew obfuscation

PBrennick

Something tells me that 'is functional' should probably be ' is allowed to function.'  I say this because old Oerating Systems can still be installed on these machines and everything will work okay.

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

MichaelW

Updated the first post for WinIo Version 3.0.
eschew obfuscation