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
01/17/12 08:47
Read: 405 times
Beaverton Or

#185534 - Not Really!!
Responding to: ???'s previous message
Donagh Choghlan said:
So when you use an IF statment it will only check the condition once at the time of assembley. I get it now, makes the old IF statment pretty pointless to use so.
Thanks Maarten

The IF statement in assembler has plenty of good uses. You may use it to include/exclude some code into/from a build. Lets say that you have a 456K byte source file that all told compiles to 46K of 8051 machine code. However you are using an 8051 that has only 32K bytes of FLASH in a family of products with different versions. Each version of the product has a varying set of features which does not use the whole complement of the program code. You can use IF/ELSE/ENDIF (or other suitable pseudo ops fitted to your specific assembler) to selectively compile which parts of the code to compile into each product version. Command line defines can be used from the build environment to specify which version to build. Hopefully each version comes in at under 32K.

Michael Karas

List of 17 messages in thread
Conditional Statements      Donagh Choghlan      01/17/12 02:57      
   Hex constants?      Oliver Sedlacek      01/17/12 03:18      
      0x00, 0x01, 0x02??      Donagh Choghlan      01/17/12 03:28      
   What is the octothorpe?      David Prentice      01/17/12 03:31      
      #      Donagh Choghlan      01/17/12 03:40      
         Immediate or not      Per Westermark      01/17/12 07:31      
      what is an octothorpe?      Andy Peters      01/17/12 10:49      
         Previously, on      Andy Neil      01/17/12 15:02      
   Problem solved, query still remains      Donagh Choghlan      01/17/12 03:54      
      Do some trial and error      David Prentice      01/17/12 04:14      
      Check the CJNE instruction...      Robert Revens      01/17/12 06:31      
         Handy that!      Donagh Choghlan      01/17/12 07:18      
      run time vs compile time      Maarten Brock      01/17/12 07:14      
         IF only at assemble      Donagh Choghlan      01/17/12 07:23      
            Not Really!!      Michael Karas      01/17/12 08:47      
               I second that      Erik Malund      01/17/12 08:58      
            Hw variants or debugging are big users of conditionals      Per Westermark      01/17/12 09:40      

Back to Subject List