flat assembler
Message board for the users of flat assembler.

Index > Main > Simple help for a noob : DOS16&DOS32 vs Win32&Win64

Author
Thread Post new topic Reply to topic
dedndave



Joined: 18 Dec 2008
Posts: 4
Location: Mesa, Az
dedndave 18 Dec 2008, 15:15
Hi -
I have written assembler for years (started on 4004/8008 - lol).
I am, however, new to 32-bit code.
I have a VERY simple task to complete in a minimal amount of time.
I have installed FASM and MASM32, hoping to get it done.
Unfortunately, I do not have time to wade through piles of documentation
or learn which includes I need, etc.
All the examples I have looked at are way more complicated than what I need.
I am sure there is a SIMPLE example somewhere that will help.
I only need to perform the following:
1) open a file random (INT 21, func 3D02)
2) set file pointer (INT 21, func 4200)
3) read a portion of a file (INT 21, func 3F)
4) examine/modify a few bytes in the buffer
5) set file pointer again
6) write the buffer back to the file (INT 21, func 40)
7) close the file (INT 21, func 3E)
8) exit with a return code (INT 21, func 4C)
That is it. I don't even need std i/o for this little project.
If you could point me to a simple example, I would greatly appreciate it.
I think FASM is just what I need, as it looks even simpler than the
MASM 5.1 I am accustomed to. Let me know if that is wrong.
A World Of ThanX,
Dave

EDIT by DOS386 2008-12-26 : enhanced subject and moved from DOS into Main
Post 18 Dec 2008, 15:15
View user's profile Send private message Yahoo Messenger Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 18 Dec 2008, 15:42
There are examples included with the fasm download. Are all of those not suitable to get you started?

From your description above it seems that you don't need any 32Bit code. All the DOS INT 0x21 functions are 16Bit only.

There are many patch type programs already posted on the 'Net. Just search for DOS patch programs, although most would be written for MASM syntax but it can easily be converted to fasm.
Post 18 Dec 2008, 15:42
View user's profile Send private message Visit poster's website Reply with quote
dedndave



Joined: 18 Dec 2008
Posts: 4
Location: Mesa, Az
dedndave 18 Dec 2008, 15:51
Thank you for your quick reply revolution.
Yes - I have a 16 bit version that works great.
I wrote it in about 20 minutes - lol.
But, it needs to run on Vista x64.
I am familiar with MASM 5.1, but have never written anything for 32 bit.
By "patch", do you mean there are programs that could convert my 16-bit
program to 32-bit code?
- Dave
Post 18 Dec 2008, 15:51
View user's profile Send private message Yahoo Messenger Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 18 Dec 2008, 15:58
By patch I mean a program that does what you describe in 8 steps in the first post.

Vista will run your DOS program in a DOS window. Although you will likely have trouble if your program needs to access long file names. If you want to convert it to 32Bit then you need to use the Windows API and not the INT 21's.
Post 18 Dec 2008, 15:58
View user's profile Send private message Visit poster's website Reply with quote
dedndave



Joined: 18 Dec 2008
Posts: 4
Location: Mesa, Az
dedndave 18 Dec 2008, 16:01
Ok - thank you for your help.
I am off to learn about the API - lol.
Post 18 Dec 2008, 16:01
View user's profile Send private message Yahoo Messenger Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 18 Dec 2008, 17:33
you are not forced to learn every APIs.
just the needed ones.

and off course, all the theory about API should be read.

that's why i never use windows api. Smile or just to play with a little code picked on this forum ( tks all)
Post 18 Dec 2008, 17:33
View user's profile Send private message Visit poster's website Reply with quote
dedndave



Joined: 18 Dec 2008
Posts: 4
Location: Mesa, Az
dedndave 19 Dec 2008, 00:16
Thank you all for your help.
For now, I will release my patch in 16-bit form.
Those who have Vista x64 will have to find a work-around for now.
I knew I would have to learn this stuff some day - lol.
I was hoping I would get old and die, first.
- Dave Laughing
Post 19 Dec 2008, 00:16
View user's profile Send private message Yahoo Messenger Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1905
DOS386 26 Dec 2008, 08:11
dedndave wrote:
But, it needs to run on Vista x64.


Then you need Win32 or Win64 API, not INT $21 , and Windows subforum for further discussion.
Post 26 Dec 2008, 08:11
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.