News:

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

Its been a while.......

Started by Bronsi, March 22, 2010, 05:02:14 PM

Previous topic - Next topic

Bronsi

...........so please be gentle.

I've got some old code which has essentially been working since the mid 90s. It has been compiled with a copy of MASM 6.1 and has continued working OK with 32-bit MS OSes. Just double click the exe and away it goes. Now and again some of the code has been changed or rewritten and it has all worked OK. I've even managed to compile it in a MS-DOS virtual PC under Windows which means I may finally be able to retire the dusty DOS6.22/Win95 PC which wheezes in the corner over there.

Now this code will not run under Win 7 64-bit but it may still have a life for some.

The question is can this 16-bit code be turned into a 32-bit console app or is it just too much trouble? Will it just compile or is there a huge difference between 16 and 32 bit assembler?

Thanks.

jj2007

Normally, it should run under any OS version if you use the Virtual PC. Have you tried this option already?

As to conversion of your code, that depends on how complex, how long etc it is. To my knowledge, there is no conversion tool around, but it might be interesting to try that. After all, translating a mov ax, cx into mov eax, ecx is kind of mechanical...

MichaelW

Unless you are using the registers to manipulate addresses, the choice between 16-bit registers and 32-bit registers is mostly a matter of efficiency. The biggest problems will be with the change in address size from 16 bits to 32 bits, or with code that creates non-standard segments, manipulates segment registers, calls interrupts, uses port I/O, or accesses memory outside the program's address space.
eschew obfuscation

dedndave

from what i understand, 16-bit programs will not work under a 64-bit OS at all
but, depending on the size of the program, it shouldn't be too difficult to re-write it as a 32-bit app
the thing that gets is your way is privilege level - if you do any direct I/O, 32 and 64-bit OS's may require ring 0 privileges

Bronsi

As 16-bit software, no, it will not run natively on a 64-bit OS (Vista or Win 7) but it will run no problem under Virtual PC 2007 on a MS-DOS VPC.
The software itself is fine under Win XP or earlier.

I installed Visual C++ 2005 Express and MASM 8.0 just to have a fiddle and after some fudging around managed to compile (or try to) some of my software. I was expecting reams and reams of error messages but didn't get that. Don't know if I "did it" right, but that doesn't seem like a huge roadblock. Didn't have a clue what I was doing though.

MASM32 - what's the difference there? Haven't downloaded anything or read up yet as I tripped over this forum first.

As for the software, it does nothing too fancy, it has been (is) accounting software, wages and a couple of other things. It comprises of a "main" component which gets compiled into an exe and renamed depending on the system. This does the menu system and bits for file access and so on. Then there are various overlays for the various bits and pieces, depending on the system. Anything for specific I/O (say, LPT1) I can rip out, no problem but I'd be interested one day to see if I can get it working. I've had no exposure at all to 32-biit assembler and a lot of what I've learnt to maintain the old code I got "on the job" from the guy who originally wrote a lot of it.

Thanks for your thoughts so far. This is something I'm going to have to look at in the next few months.

MichaelW

You will need to redo all of the I/O code, replacing interrupt calls and/or port I/O with API functions. If the software implements a simple text-mode user interface, then converting it to a Windows console app should be fairly easy. A Windows GUI app would be more difficult. The file I/O should be fairly easy. The printer code can be anywhere from easy to difficult, depending on what you are trying to print and how much control you need over the printing process.
eschew obfuscation

dedndave

there have been some recent threads on printing that were very informative - use the forum search tool
otherwise, it sounds like it wouldn't be too hard to convert

masm32 is a project, actually, by Steve "Hutch" Hutchesson
it is a package of libraries, macros, include files, tutorials, and examples aimed at getting you up and running in 32-bit assembler
the project also includes this forum, of course   :P