Dunfield Development Services Inc.
APPLICATION NOTE
Home
Products
Ordering & Status
Free Download Files
Links
Notices
Contact Us

 

Dunfield Development Services Inc. 
Customer Support -- Application Note #0001

MICRO-C
Using a RAMdrive to speed up compilation.

Applies to: [Micro-C Compiler ]
Last updated: Sunday May 04, 2003 .
Application Note Index

Next ]

PROCEDURE


The MICRO-C command co-ordinator (CCxx) runs the separate phases of the compiler (MCP, MCCxx MCOxx, MACRO, SLINK, ASMxx), and uses temporary files to pass the output from one phase as the input of the next phase. By default, the temporary files are written in the current directory.

When compiling from a physical disk drive, the system must constantly seek back and forth between the input file, and the output file. This slows the compiler down. A significant performance gain can be realized by placing the temporary files on a RAMdisk, where the seek time is essentially 0 (there
is no physical disk head).

If you do not already have a RAMdisk on your system, you can define one by adding the following line(s) to your CONFIG.SYS file:

For DOS 4.0 and earlier:
DEVICE=C:\DOS\VDISK.SYS 256 /E

For DOS 5.0 and later:
DEVICE=C:\DOS\HIMEM.SYS
DEVICE=C:\DOS\RAMDRIVE 256 /E

Notes:

  1. The indicated RAMdrive size of 256k is adaquate for most users of the compiler. If you get disk full messages, or errors writing to output files, try increasing the size of the RAMdrive.

  2. The '/E' option causes the RAMdisk to be allocated in extended memory (above 1mb). If you have 1mb or less, or for some other reason do not want the RAMdisk allocated in extended memory, you may leave the '/E' off, and the drive will be allocated in conventional memory. If you are not using extended memory with DOS 5.0 or later, you may also omit the DEVICE=HIMEM.SYS line.

  3. After the disk size (256 in above examples), you can specify the RAMdrive sector size, and number of root directory entries. Refer to your DOS manual for details.

  4. Replace 'C:\DOS' in the above examples with the location of the device drivers. If you are running WINDOWS, you should use device drivers from the windows directory.

Once you have defined a RAMdisk, you must inform MICRO-C that it can place its temporary files there. This is accomplished by setting the environment variable MCTMP to a string pointing to that drive:

eg: SET MCTMP=D:\

This command should be added to your AUTOEXEC.BAT file if you wish to always place your temporary files on the RAMdrive.

Note that MCTMP is a PREFIX, and should end with a trailing '\' if you are intending to use it as a directory pointer. Also be sure to change the 'D:' in the above example to the correct drive letter of your RAMdisk if necessary.

It is common practice to place a '$' at the end of the MCTMP prefix, so that temporary files generated by the compiler can be easily identified:

eg: SET MDTMP=D:\$

This causes all temporary files created in D:\ to begin with the '$' character.

 

 

 

More Application Notes Next ]

© 2008 Dunfield Development Services Inc.     View our Privacy Statement
Refunds given at the discretion of management.
 Last Updated:  Tuesday, March 18, 2008