flat assembler
Message board for the users of flat assembler.

Index > Windows > Before Windows 95 in FASM

Author
Thread Post new topic Reply to topic
nkeck72



Joined: 28 May 2015
Posts: 83
Location: 0000:7C00
nkeck72 27 Sep 2015, 23:19
Everyone has heard of Win32 and Win64 programming in FASM. But what about writing those old (and nostalgic) Win 3.11 (idk if this is in PE format or MZ) and Win 1.0/2.0 programs in MZ format? Does FASM have a preset format statement built in for these kinds of programs or do you have to write the 'format MZ' pseudo-instruction and do the GUI setup code yourself?

P.S. I have never written anything below PE format so I was just wondering if it was possible to use FASM to write for these older Windows versions?

_________________
It may look hard, but it won't take long if you take it one byte at a time.

NOS: www.github.com/nkeck720/nos
Post 27 Sep 2015, 23:19
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20300
Location: In your JS exploiting you and your system
revolution 28 Sep 2015, 03:21
'format mz' will generate a 16-bit MZ exe format file. That should be fine for 16-bit versions of Windows and DOS.
Post 28 Sep 2015, 03:21
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 28 Sep 2015, 05:44
For 16-bit Windows you need to create the NE executable, and fasm never did support that output format. However you could try to build it from scratch with data directives, just like some people did it with PE.

On Windows 3.11 it was also possible to run 32-bit programs after installing the Win32s extension. The PEDEMO example from fasm package did run correctly under Win32s and you may notice that it still mentions it in the comment next to relocation section definition, because Win32s would not run a PE executable without the relocation information.
Post 28 Sep 2015, 05:44
View user's profile Send private message Visit poster's website Reply with quote
ACP



Joined: 23 Sep 2006
Posts: 204
ACP 28 Sep 2015, 09:29
Here is another interesting link - how to create LE in FASM: http://board.flatassembler.net/topic.php?t=7122

I think the biggest problem would be creating VxD using FASM for old Windows. If you don't need VxD than everything you will need to build Win16/Win32 app for pre Win95 systems can be found here in forum.

You may also want to research a subject of dos extenders. This may help you to address some file format and memory issues (however dos extenders bring their own set of issues as well when programming). In older systems - depending on the software configuration you are talking about - you may look for extenders supporting VCPI and DPMI. There are also two good books regarding assembly language programming (none of them uses FASM synatx) for systems predates Win95:

    Windows Assembly Language and Systems Programming: 16- and 32-Bit Low-Level Programming for the PC and Windows

    Extending DOS
Post 28 Sep 2015, 09:29
View user's profile Send private message Reply with quote
nkeck72



Joined: 28 May 2015
Posts: 83
Location: 0000:7C00
nkeck72 29 Sep 2015, 10:49
The wiki page there doesn't seem to explain the format... is there anywhere I can see the format structure?
Post 29 Sep 2015, 10:49
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 29 Sep 2015, 11:39
I recall that Ralf Brown's Interrupt List contained some information about this format. Search for the "Format of new executable header" phrase in the description of function 4Bh of interrupt 21h.
Post 29 Sep 2015, 11:39
View user's profile Send private message Visit poster's website Reply with quote
ACP



Joined: 23 Sep 2006
Posts: 204
ACP 29 Sep 2015, 11:47
If you are refering to NE file format here are useufl links (Tomasz is right that Ralf Brown Interrupt List describes it)

http://www.ctyme.com/intr/rb-2939.htm#Table1596
http://wiki.osdev.org/NE
Post 29 Sep 2015, 11:47
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.