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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Michael Karas
11/07/03 08:32
Read: 1062 times


 
#58026 - RE: Answer
Responding to: ???'s previous message
The code I edited is not the same as the C version compiled. It is made somewhat shorter....although I suspect, even if it could be made a little shorter, there would be little savings. Actually the C compiler does a downright excellent job.

Even though I have shown an initial hack at an A51 source for this polling routine the puzzler is still open for posts from anyone who wishes to show us their talents in reducing the size of the code while retaining the functionality.

The original version of this code was done on a 68HC11 where in it was about 3X longer in assembler. I then have used it on a PC to support the discrete inputs of a parallel in port of a data acquisition board. The C code I put in the puzzler is a virtual copy of the C code compiled with Borland C of the PC implementation. The PC compiled version resulted in very much similar code as the 8051 version except that it was compiled with unsigned int variable sizes to support 16 inputs. I have also used the same code on a MC68332 platform with unsigned long variables for 32 inputs. (Note the '332 has 32 bit registers so the compiled code is almost the same size as on the '51).

Michael Karas


List of 14 messages in thread
TopicAuthorDate
8052 Puzzler #2      Michael Karas      11/06/03 00:56      
   RE: 8052 Puzzler #2      Jez Smith      11/06/03 02:30      
      RE: 8052 Puzzler #2      Michael Karas      11/06/03 07:42      
   RE: 8052 Puzzler #2      Jez Smith      11/06/03 03:20      
   smaller is beatiful      Peter Dannegger      11/06/03 08:19      
      RE: smaller is beatiful      Michael Karas      11/06/03 08:42      
      RE: smaller is beatiful      Michael Karas      11/06/03 17:08      
         RE: smaller is beatiful      Peter Dannegger      11/07/03 06:39      
   RE: 8052 Puzzler #2      Mahmood Elnasser      11/07/03 04:17      
      Answer      Andy Neil      11/07/03 05:34      
         RE: Answer      Michael Karas      11/07/03 06:05      
            RE: Answer      Mahmood Elnasser      11/07/03 08:08      
               RE: Answer      Erik Malund      11/07/03 08:23      
               RE: Answer      Michael Karas      11/07/03 08:32      

Back to Subject List