Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do one generate a .SYS file ?

Status
Not open for further replies.

anuragmathur

Programmer
Sep 12, 2001
2
0
0
IN
Please, tell me about , how can one compile or assemble a file to a .SYS extension file (like himem.sys) from a program in C or assembly language on the MS-DOS or WIN9x/NT/2k. What are these files? How can they be usefull for writing a big application.
 
Usually .sys files are plain binary files(ie executable files with no header data and relocation tables). They are used for driver programs or ISRs. They can be generated bya any assembler. I use the assembler NASM. The syntax for generating a .sys file is : nasm progname.asm -f bin -o progname.sys
 
An older method is by using the exe2bin program which used to be included with DOS. Note that SYS files are typically one 16-bit segment. Compile and link into exe, then run it through exe2bin.

If you don't have exe2bin, a short debug script would do:

N file.sys
W
Q

To use, do this:
debug file.exe <debug.scr

&quot;Information has a tendency to be free. Which means someone will always tell you something you don't want to know.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top