flat assembler
Message board for the users of flat assembler.

Index > Windows > [Solved] DOS and Win32 functions

Author
Thread Post new topic Reply to topic
Kazyaka



Joined: 10 Oct 2011
Posts: 62
Location: Earth
Kazyaka 10 Oct 2011, 15:28
Hello,
I'm beginner and I wonder how I can make program supporting DOS functions like file and console operations and using DLLs' functions like CreateWindowEx.

Can someone posts simple example i. e. program writing data from inputbox to file and explain me code?


Last edited by Kazyaka on 10 Oct 2011, 17:33; edited 2 times in total
Post 10 Oct 2011, 15:28
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1678
Location: Toronto, Canada
AsmGuru62 10 Oct 2011, 16:31
I am not sure I understand your question.
DOS is 16-bit OS, so it does not have any 32-bit operations.
If you want to use console I/O and use files in Windows - you need to use Windows API - it includes all functions for console and file operations:

Take a look here (paste that full link into browser):
http://msdn.microsoft.com/en-us/library/aa383686(v=vs.85).aspx

Section Console has functions for console I/O. You can even use colors like DOS has!
Section File Management has everything to do with files.
Post 10 Oct 2011, 16:31
View user's profile Send private message Send e-mail Reply with quote
Kazyaka



Joined: 10 Oct 2011
Posts: 62
Location: Earth
Kazyaka 10 Oct 2011, 17:20
AsmGuru62,
thank you for reply.
My wrong about DOS. This link is very useful.

I've one question:
21h operations are faster than using DLL, yes?
Post 10 Oct 2011, 17:20
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1678
Location: Toronto, Canada
AsmGuru62 10 Oct 2011, 17:24
21h operations are not valid in Windows.
Only API is now used to do the stuff which 21h was doing.

When you start the old DOS program in Windows - it gets loaded into NTVDM.EXE - the DOS emulator, so it does not run on native Windows.

When you create a native Windows EXE using FASM PE Format - it is not DOS, so it cannot use 21h stuff - it will crash if you try it. In fact it will crash if you use any of old DOS interrupts: 16h, 10h or some other stuff.
Post 10 Oct 2011, 17:24
View user's profile Send private message Send e-mail Reply with quote
Kazyaka



Joined: 10 Oct 2011
Posts: 62
Location: Earth
Kazyaka 10 Oct 2011, 17:32
Thanks again! Now I understand everything.
Topic to close.
Post 10 Oct 2011, 17:32
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.