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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/14/05 09:20
Read: times


 
#89614 - OK, here it is!
Responding to: ???'s previous message
Mehdi said:
So,Come to help solving rahul's problem

OK, this is what he say he needs to do:
Rahul Sadagopan said:
my while(1) has all the characters that need to be printed ... i dont want charaters printing beyond the margin ... this sequence of printing and paper feeding has to be done infintely long.
http://www.8052.com/forum/read.phtml?id=88937

So he's doing the familiar printer self-test pattern:
    0123456789abcdefghijklmnopqrstuvw
    xyzABCDEFGHIJKLMNOPQRSTUVWXYZ`!"£
    $%^&*()_+=-[{]}#~'@;:/?.>,<|0123
    456789abcdefghijklmnopqrstuvwxyzA
    BCDEFGHIJKLMNOPQRSTUVWXYZ`!"£$%^&
    etc, etc,...
This can be very easily implemented in a perfectly straightforward loop with no need for any timers, unstructured jumps, or other kludges:
character_to_print := first printable character -- Start with the 1st printable character in the printer's character set
characters_printed := 0;                        -- We haven't printed anything yet!

-- Infinite loop to continuously print all characters from the printer's character set,
-- inserting line breaks where required
repeat
{
   print character_to_print;

   -- Count another character printed;
   -- Check if we now need to insert a line break
   increment characters_printed;
   if characters_printed >= max characters per line then
   {
      print newline;
      characters_printed := 0 -- Now back at the start of a line
   }

   -- Prepare to print the next character from the character set;
   -- If we've just done the last character, start again at the first
   increment character_to_print;
   if character_to_print > last printable character then
   {
      character_to_print := first printable character 
   }
} forever
The above assumes a character printer, but exactly the same principle would apply if you're driving the dots directly - you just count columns instead of characters.

instead of saying your idea is incorrect

I didn't say it was incorrect; I said it was bad idea - especially when the aim can be achieved in such a simple & straightforward manner!




List of 53 messages in thread
TopicAuthorDate
problem with labels            01/01/70 00:00      
   First of all....            01/01/70 00:00      
   Jump to a specific point            01/01/70 00:00      
      Don't Do It!!            01/01/70 00:00      
         DO it!            01/01/70 00:00      
            No, don't!            01/01/70 00:00      
      Same label problem            01/01/70 00:00      
      Message Not Useful?            01/01/70 00:00      
         (-1 Message Not Useful)            01/01/70 00:00      
            Your wish...            01/01/70 00:00      
   break            01/01/70 00:00      
      this is for a printer            01/01/70 00:00      
         Bizarre!            01/01/70 00:00      
            Proportional font?            01/01/70 00:00      
               count columns            01/01/70 00:00      
                  columns?            01/01/70 00:00      
                     intelligent            01/01/70 00:00      
                  line printers            01/01/70 00:00      
                     hit me with a thud            01/01/70 00:00      
                        DP Lineprinters            01/01/70 00:00      
         breaking out of loops            01/01/70 00:00      
   the RETI barrier            01/01/70 00:00      
      The clever 8051 designers!            01/01/70 00:00      
         Clever            01/01/70 00:00      
         Bunch of bull.            01/01/70 00:00      
            RE:Bunch of bull.            01/01/70 00:00      
               Mehdi            01/01/70 00:00      
   Don't start from here            01/01/70 00:00      
   sdcc says unreachable code !            01/01/70 00:00      
      You get rid of it by....            01/01/70 00:00      
      Just don't do it!            01/01/70 00:00      
      Structure            01/01/70 00:00      
      global and local variables            01/01/70 00:00      
         Re:            01/01/70 00:00      
            Give It Up Rahul.            01/01/70 00:00      
            Man @ bottom of hole should stop digging            01/01/70 00:00      
               Man @ bottom of hole            01/01/70 00:00      
                  Stop digging!!            01/01/70 00:00      
                  OK, here it is!            01/01/70 00:00      
                     counting is getting difficult            01/01/70 00:00      
                        Counting should be easy!            01/01/70 00:00      
                           as a starter...            01/01/70 00:00      
                              solved !            01/01/70 00:00      
            Back to Basics            01/01/70 00:00      
      Blinker            01/01/70 00:00      
         need to jump..            01/01/70 00:00      
            Do NOT jump!            01/01/70 00:00      
            Timer            01/01/70 00:00      
   Lookup Table Character Generator            01/01/70 00:00      
      bit based lookup table            01/01/70 00:00      
         Try this:            01/01/70 00:00      
      Character building            01/01/70 00:00      
      Things are working good..            01/01/70 00:00      

Back to Subject List