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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
James Hinnant
02/14/18 17:43
Read: 274 times
Silicon Valley

#190839 - Assembly vs. Keil
Responding to: Michael Karas's previous message
Once I had to optimize an 8051 project (mostly for execution time, also for space, at less priority). I started with the Keil C compiler disassembly output.

It wasn't very hard to beat the compiler, and Keil said the same in their documentation (roughly that they didn't know what the end application would be and they couldn't produce assembly output optimized better than end application engineers could do). What I remember is that there was a lot of switching in and out of registers unnecessarily. Maybe they strang together a bunch of library macros to generate their output.

This was around 2001, though; They've probably gotten a lot better. I've used Keil more recently for ARM, but I didn't need to optimize the output so I probably didn't look at it too hard.

As far as this particular question, I can picture some other advantages. Assembly could be easier to review for critical systems, as long as you've got people who can read it. If you're only reviewing high-level source you're essentially trusting the compiler output (at least as far as review is concerned).

Re Razman's original question: there is a Tutorial link on the left button bar, with various useful information including a 16-bit math tutorial for the 8051. The FAQ links and pages appear to be broken (the FAQ frame is empty in both Firefox and Chrome, and a wget on it returns a 404 error). But the individual FAQ pages are still there. You can google " FAQ" and get useful hits.

List of 16 messages in thread
Arithmetic operation with signed number & fractional number      Razman Ramedan      11/21/17 23:32      
   Fractional Arithmetic      Michael Karas      11/22/17 03:34      
      agree      Erik Malund      11/22/17 08:29      
   Why Assembler?      Andy Neil      12/05/17 01:49      
      Hard to do better.      Michael Karas      01/25/18 21:36      
         Assembly vs. Keil      James Hinnant      02/14/18 17:43      
            assembly vs C      Erik Malund      02/15/18 08:18      
               Re: assembly vs C      James Hinnant      02/15/18 15:15      
                  In the good old days...      Kai Klaas      02/16/18 05:56      
                     in the new days      Erik Malund      02/17/18 08:52      
   Hi Razman, here are some links      James Hinnant      02/15/18 15:41      
      Code samples      James Hinnant      02/15/18 15:55      
         Oops - code library is broken      James Hinnant      02/17/18 15:43      
      A bit late      Andy Neil      02/19/18 16:13      
         threads autolocking at approx. 2 months      James Hinnant      02/20/18 16:49      
            threads autolocking      Andy Neil      02/21/18 03:15      

Back to Subject List