From: "Tom St Denis" Newsgroups: comp.os.msdos.djgpp References: <3b580b15$0$274$bb624dac AT diablo DOT uninet DOT ee> Subject: Re: pokeb peekb Lines: 57 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2462.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000 Message-ID: Date: Fri, 20 Jul 2001 11:23:10 GMT NNTP-Posting-Host: 24.112.8.23 X-Complaints-To: abuse AT home DOT net X-Trace: news3.rdc1.on.home.com 995628190 24.112.8.23 (Fri, 20 Jul 2001 04:23:10 PDT) NNTP-Posting-Date: Fri, 20 Jul 2001 04:23:10 PDT Organization: Excite AT Home - The Leader in Broadband http://home.com/faster To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Tonu Aas" wrote in message news:3b580b15$0$274$bb624dac AT diablo DOT uninet DOT ee... > > > > > And I think that djgpp is not the best choise to produse > > > smallest/fastest program to show 01h on screen. > > > Who cares about the startup code? You don't meant to say that someone > > would actually write a program that just puts the character in the middle > > of a screen and exits, do you? Who would need a ridiculous toy program > > like that? That's even less useful than the proverbial hello world. > > The question was: > > 1) what's the shortest complete program that pokes a face (ascii 1) > into the exact middle of the screen and exits to DOS ? > 2) what , if it has to be fast (~50 cycles) > 3) what , if it is required to compile on a large variety of compilers ? > > So - djgpp is not the best choise. And it's not stupid thread. > It's about choosing right compiler for solving problem. > And for that DJGPP is not the best. But for other a little bit more complex > programs it's good and for more complex programs it's best. > > For example: Borland compiler 12116 bytes; and portable. > #include > ------------------------------------------ > void main(void) > { > struct text_info info; > > gettextinfo(&info); > gotoxy(info.screenwidth/2, info.screenheight/2); > putch(0x01); > } > ------------------------------------------- > > BTW. Your result is good too. I doubt that's 50 cycles though. Recall that the C lib startup code is probably around a 1000 cycles. what you want is some trivial asm program like [bits 16] [section .text] [org 100h] mov ax,0b800h mov ds,ax mov [_whatever_screen_location],1 ret Which is at worse around 5 cycles on my athlon. Tom