delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/20/07:01:20

From: "Tonu Aas" <tonu AT ids DOT ee>
Newsgroups: comp.os.msdos.djgpp
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010719172847 DOT 2839B-100000 AT is>
Subject: Re: pokeb peekb
Date: Fri, 20 Jul 2001 12:30:16 +0300
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.3018.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300
Lines: 37
Message-ID: <3b580b15$0$274$bb624dac@diablo.uninet.ee>
NNTP-Posting-Host: 194.204.53.21
X-Trace: 995625749 diablo.uninet.ee 274 194.204.53.21
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> > > >     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 <conio.h>
------------------------------------------
void main(void)
 {
  struct text_info info;

  gettextinfo(&info);
  gotoxy(info.screenwidth/2, info.screenheight/2);
  putch(0x01);
 }
-------------------------------------------

BTW. Your result is good too.



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019