I have a rather large pgm I wrote in ASM for Win95/98 (works fine for ME, also) and everything works fine. It is a database and control system pgm. Since all the OS's now are similar to WinNT (2000/XP), I would like to alter the pgm to run on these OS's. At this time, it will run on NT but eventually crashes. All my OS variables, structures, and PROCDESC's are specified in one .INC file, so I'm not sure how to alter them to run OK on NT/2000/XP. In addition, I'm considering buying WinXP. Since TASM5 is a DOS pgm, will it run and assemble my pgm. Thanx in advance for any advice and help.
Posted on 2001-11-05 08:14:00 by DaveTX47
TASM5 behaves sorta okay, so it should run under NT/2k/XP (and
indeed does). And sure it produces PE output files. But just use
masm and be happy, tasm is dead.

As for working under nt/2k/xp, there's a few simple rules that have
been stated over and over again. Preserve ebx/esi/edi/ebp (if used),
and remember to return 0 in your DlgProc if you don't handle the
Posted on 2001-11-07 04:18:42 by f0dder
Thanx fOdder for the prompt response. I learned TASM while working on a BSEE degree and have stuck w/ it, including buying TASM5 to reprogram a pgm I wrote for DOS to a Win32 pgm. The .ASM file is 350KB at this point and although I have MASM (downloaded from Hutch awhile back), I feel I'm too far along to switch, esp. since the pgm works fine on Win95/98/ME. It is a machine(s) control pgm and because I could never get the machine(s) to communicate w/ the computer (ReadFile), I used 'out dx,al' and 'in al,dx' from my DOS pgm. These work fine, but will they work in Win2000/NT/XP?
Posted on 2001-11-07 10:28:51 by DaveTX47
no, in/out are disallowed under nt/2k. At least what I know of.
Now, if you reprogrammed the I/O permission bitmask in the
tss structure... but there's no way you'll be allowed to do that, either ;).
Time to find an I/O port access library.
Posted on 2001-11-07 10:35:44 by f0dder
Thanx again, fOdder. I had a feeling in/out would not work w/ WinNT/2k. I bought a book awhile back about communications using the winapi's and structures. All the author's examples are written in C++ which is Greek to me. I could get everything, as I could interpret it, to set up in my .asm code. It involved sending a single byte (WriteFile) to the machine being controlled which worked OK, but the MCU inside the machine was to acknowledge receipt by sending a byte back to the computer. There's where the problem came in. Using in/out all works fine, but using ReadFile for the acknowledgement just hung up the pgm. I tried tinkering w/ the DCB and using the TimeOut structures - still nothing. It looks like I'll have to get the book out and try again. Thanx again for you help and advice.
Posted on 2001-11-07 14:26:36 by DaveTX47
Have a look at the Kernel Mode thread on the main
board for a link to a low level I/O discussion
and some hints.

Posted on 2001-11-08 01:20:10 by farrier

What you can do if the data transfer rate is not that high either way is to open the COM or PRINTER port directly as a file and use that to send and receive data in both directions. A printer port is usually faster if its a two way type but if the speed is not critical, a serial port is probably fast enough.


Posted on 2001-11-08 19:55:49 by hutch--
i downloaded the files winio.zip and asmio.zip referenced in the kernel message and have done battle with them all day trying to get 'winio.lib' , 'winio.dll' , and 'winio.inc' to work to no avail. I placed the pertinent function calls written by Exagone in my W32.inc file, changing PROTO to PROCDESC for TASM, added the line 'INCLUDELIB winio.lib' at the beginning of my pgm, and used 'call LoadLibrary, OFFSET szWinIO',which I defined in my data segment, at the appropriate place in my code segment. When I run 'make -B -fmakefile' everything goes well until I get the msg: Fatal: Bad object file 'C:\tasm\WinPkg\winio.lib near file offset 0'.
I downloaded the zip files a second time just in case an error occured in my first download. No luck - same error msg. Since these downloaded files appear to be specific for MASM, is it possible a .lib file could generate this msg???
Posted on 2001-11-08 20:03:24 by DaveTX47
I think masm uses a different library format than tasm.. However you can rewrite the lib in tasm yourself. The one supplied with WinIO didn't work for masm, so I created my own the way Iczelion explained at his site (he has a tutorial about making libraries for dlls when you don't have them).

Posted on 2001-11-09 15:53:25 by Thomas
masm uses coff (well, microsoft-coff. There's also djgpp-coff. The
only difference is regarding how pc-relative fixups are handled).
Tasm uses stupid old OMF.

Skip tasm, use masm :).
Posted on 2001-11-09 16:20:22 by f0dder
I certainly appreciate everyones' advice. I've been beating my head up against the wall trying to get 'Winio' to work because of it's simplicity. I downloaded Iczelion's tutorial on building a .lib file. I tried making changes to the 'Make.bat', but the switches and code setup won't work for TASM. Does anyone know the 2 line code for the 'Make' file for TASM before I completely give up on it??? Thanx again.
Posted on 2001-11-11 10:21:11 by david11372@aol.com