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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/20/04 20:35
Read: times


 
#68930 - Optimise your C
Responding to: ???'s previous message
Iztok Moravsek said:
Is there any possibility to force C language to generate DJNZ.(Now is DEC Data, MOV A,Data, JZ ...)


No, there isn't.
As I said before, there is no way to force any 'C' compiler to generate any specific machine instructions. That's the whole point.

However, the Keil C51 compiler definitely will use the DJNZ instruction when it can:
http://www.keil.com/discuss/docs/thread4066.htm
http://www.keil.com/discuss/docs/thread1082.htm

There must be something in your 'C' source that prevents it from doing so. You need to write your 'C' source code with due consideration of the underlying execution environment; ie, the 8051 architecture, instruction set, etc.

You will need to read both the Keil C51 Manual, and the 8051 "bible" to understand this fully.

The following documents are commonly referred to as "the bible" for the 8051:

http://www.semiconductors.philips.com/acrobat/v...ARCH_1.pdf
http://www.semiconductors.philips.com/acrobat/v...UIDE_1.pdf
http://www.semiconductors.philips.com/acrobat/v...WARE_1.pdf

The 80C51_FAM_PROG_GUIDE_1.pdf describes the 8051 Instruction Set.


List of 18 messages in thread
TopicAuthorDate
Keil Halt            01/01/70 00:00      
   Use Assembler.            01/01/70 00:00      
   RE: Keil Halt            01/01/70 00:00      
      RE: Keil C51 uses DJNZ            01/01/70 00:00      
         RE: Keil C51 uses DJNZ            01/01/70 00:00      
            RE: Keil C51 uses DJNZ            01/01/70 00:00      
   Optimise your C            01/01/70 00:00      
      RE: DJNZ            01/01/70 00:00      
   RTFM?            01/01/70 00:00      
      RE: RTFM?            01/01/70 00:00      
         RE: RTFM?            01/01/70 00:00      
            RE: RTFM?            01/01/70 00:00      
               RE: RTFM?            01/01/70 00:00      
                  RE: RTFM?            01/01/70 00:00      
                     Keil Halt - Primer            01/01/70 00:00      
                        RE: Keil Halt - Primer            01/01/70 00:00      
                           This way lies disaster!!            01/01/70 00:00      
   RE: Keil Halt            01/01/70 00:00      

Back to Subject List