Message board for the users of flat assembler.
> Main > Simple help for a noob : DOS16&DOS32 vs Win32&Win64
dedndave 18 Dec 2008, 15:15
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,
EDIT by DOS386 2008-12-26 : enhanced subject and moved from DOS into Main
|18 Dec 2008, 15:15||
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.
|18 Dec 2008, 15:42||
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?
|18 Dec 2008, 15:51||
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.
|18 Dec 2008, 15:58||
dedndave 18 Dec 2008, 16:01
Ok - thank you for your help.
I am off to learn about the API - lol.
|18 Dec 2008, 16:01||
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. or just to play with a little code picked on this forum ( tks all)
|18 Dec 2008, 17:33||
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.
|19 Dec 2008, 00:16||
DOS386 26 Dec 2008, 08:11
But, it needs to run on Vista x64.
Then you need Win32 or Win64 API, not INT $21 , and Windows subforum for further discussion.
|26 Dec 2008, 08:11||
< Last Thread | Next Thread >
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.