Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/25/08 17:38
Read: times


 
#151426 - THINK(ing)
Responding to: ???'s previous message
#include <reg52.h>
#define MAXCHARS_ON_LINE   10
#define CHAR_MASK          0xBF
#define high 				1        
#define low  				0        
sbit clear = P3^0;    
sbit write = P3^1;    
#define uint unsigned int
#define uchar unsigned char
void msec(uint x) 
    { uchar j;
    while (x-->0)
        {for(j=0;j<125;j++);}}
void code clear_display() 
    { clear=high;
    clear=low;
    clear=high;}
void code write_enable() 
    {write=high;
    write=low;
    write=high;}
void code word_delay()
    {msec(3500);}
unsigned char *phrases[] = {"Short","Medium","Very long" };                                       
#define MAX_LINES (sizeof(phrases) / sizeof(char *))
void put_phrase (unsigned char *phrasePointer             
    ) {while (*phrasePointer != 0) {            
		P0 = (*phrasePointer++);            
		write_enable();}}            
void main( void ) {                           
    int i;                                    
    unsigned char phrase;                     
	clear_display();
    for (i=0; i<5; i++) {                     
        for (phrase = 0;                      
             phrase < MAX_LINES;
             phrase++) {
             put_phrase(phrases[phrase]);     
             word_delay();
        	 clear_display();
			 }                                
        for(;;);}}                                 
/*
:03000000020003F8
:0C000300787FE4F6D8FD75811302004AF6
:10011C0053686F7274004D656469756D0056657235
:07012C0079206C6F6E670083
:0B0133000908FF011CFF0122FF012949
:1000E800EF1FAA0670011ED39400EA9400400BE4A7
:0A00F800FDEDC3947D50E90D80F783
:0101020022DA
:07013F00D2B0C2B0D2B02221
:07014600D2B1C2B1D2B12217
:07014D007FAC7E0D0200E80B
:1000C2008B118A128913AB11AA12A91312010360B0
:1000D200140513E5137002051214F9120103F580D9
:0600E20012014680E1223C
:10008F0012013FE4FFFEC3EF9405EE6480948050AD
:10009F0021E4FCEC75F003A42408F8860308E6FAC3
:1000AF0008E6F91200C212014D12013F0CBC03E326
:0200BF0080FEC1
:0100C100221C
:10000F0002008FE493A3F8E493A34003F68001F278
:10001F0008DFF48029E493A3F85407240CC8C333F2
:10002F00C4540F4420C8834004F456800146F6DFC1
:10003F00E4800B0102040810204080900133E47E1D
:10004F00019360BCA3FF543F30E509541FFEE493B6
:10005F00A360010ECF54C025E060A840B8E493A37D
:10006F00FAE493A3F8E493A3C8C582C8CAC583CAA8
:10007F00F0A3C8C582C8CAC583CADFE9DEE780BE60
:01013E0000C0
:10010300BB010689828A83E0225002E722BBFE02FA
:09011300E32289828A83E493222D
:00000001FF
*/


Acknowledgements to
Russ Cooper
Michael Karas


List of 54 messages in thread
TopicAuthorDate
Best way to consolidate....out of memory            01/01/70 00:00      
   isn't this the classical gotcha?            01/01/70 00:00      
   There was a hint here....            01/01/70 00:00      
      Not const            01/01/70 00:00      
         Not necessarily            01/01/70 00:00      
            Hmmm...            01/01/70 00:00      
               Hmmm, indeed            01/01/70 00:00      
               Why?            01/01/70 00:00      
                  One reason ... and the prolly the original intent            01/01/70 00:00      
                     Obviously            01/01/70 00:00      
                        Speed            01/01/70 00:00      
                           Rogue programs?            01/01/70 00:00      
                              Yes. And stupid programmers            01/01/70 00:00      
                                 True            01/01/70 00:00      
                           cases            01/01/70 00:00      
                        The Obvious...            01/01/70 00:00      
                           Fair enough            01/01/70 00:00      
                              make sure the developer doesn't do something stupi            01/01/70 00:00      
                              Const to Code EPROM or FLASH,,,            01/01/70 00:00      
                           const and volatile - for optimization            01/01/70 00:00      
                  consts in other than CODE space            01/01/70 00:00      
                     Use the extended keywords            01/01/70 00:00      
                        'const' and 'volatile'            01/01/70 00:00      
   Unreadable code!            01/01/70 00:00      
      It really was all Keils fault....;)            01/01/70 00:00      
   You don't want to start from here!            01/01/70 00:00      
      Previously, on 8052.com...            01/01/70 00:00      
      Array of string            01/01/70 00:00      
         Yes, my mistake            01/01/70 00:00      
   string concatenate            01/01/70 00:00      
      Comments            01/01/70 00:00      
         Wow......LOL            01/01/70 00:00      
            Not a C vs ASM thing            01/01/70 00:00      
               From your perspective, it may make sense            01/01/70 00:00      
      I went this direction....code padding removal?            01/01/70 00:00      
         For but one byte added to the array...            01/01/70 00:00      
         With proper ordering in source file...            01/01/70 00:00      
         Putting it all together            01/01/70 00:00      
            Spectacular Russ.....            01/01/70 00:00      
   THINK            01/01/70 00:00      
      that is surely needed            01/01/70 00:00      
      A bit easier to read?            01/01/70 00:00      
         easy to read???            01/01/70 00:00      
      typedef vs #define            01/01/70 00:00      
      I think not            01/01/70 00:00      
         Tks Russ.            01/01/70 00:00      
            THINK(ing)            01/01/70 00:00      
               ???            01/01/70 00:00      
                  Objectives.            01/01/70 00:00      
                     I beg your pardon?!            01/01/70 00:00      
                     I see            01/01/70 00:00      
   Best way to consolidate....out of memory            01/01/70 00:00      
   Why specify CODE for functions?            01/01/70 00:00      
      there is so much stuff            01/01/70 00:00      

Back to Subject List