Mail Archives: djgpp/1997/01/04/11:59:30
Matthew Kennedy wrote:
>
> POINT!!!: Why does the addition of gotoxy(1,1) add 40k of code the the
> size of the executable?? In assembler such an addition would be about 10
> bytes!
> How can I stop the whole conio (I assume) library from being linked in????
>
> Thankyou.
Using one function doesn't automatically link in the entire library.
The conio functions are contained in libc.a (methinks), which is a half-meg
in size.
Fact is, these functions are whoppers in size, along with startup code, error
checking,exit code, additions to the symbol table etc.
Plus you're compiling without optimisations ( tho' in such a tiny prog that
doesn't matter too much).
What to do?
1.Reduce the *.exe file size:
Compile with optimisations and output *.out. (Not -O3 or -m486, tho')
then strip myprog.out and coff2exe myprog.out to dump the symbol table.
Run djp myprog.exe and voila! a teensy weensy compact li'l program.
2.Write your own DOS conio functions.
No, that's not hard, just timeconsuming.
Here is gotoxy() using the BIOS video function 10h:
#include <dos.h>
void Matts_Gotoxy(char x, char y,char page) // page = video page; default = 0
{
union REGS r;
r.h.ah = 0x2;
r.h.bh = page;
r.h.dh = y;
r.h.dl = x;
int86(0x10,&r,&r);
}
And then the remaining 20+ functions.
Good luck,
Elliott
- Raw text -