??? 01/17/12 15:47 Read: times |
#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 |
Topic | Author | Date |
Conditional Statements | 01/01/70 00:00 | |
Hex constants? | 01/01/70 00:00 | |
0x00, 0x01, 0x02?? | 01/01/70 00:00 | |
What is the octothorpe? | 01/01/70 00:00 | |
# | 01/01/70 00:00 | |
Immediate or not | 01/01/70 00:00 | |
what is an octothorpe? | 01/01/70 00:00 | |
Previously, on 8052.com | 01/01/70 00:00 | |
Problem solved, query still remains | 01/01/70 00:00 | |
Do some trial and error | 01/01/70 00:00 | |
Check the CJNE instruction... | 01/01/70 00:00 | |
Handy that! | 01/01/70 00:00 | |
run time vs compile time | 01/01/70 00:00 | |
IF only at assemble | 01/01/70 00:00 | |
Not Really!! | 01/01/70 00:00 | |
I second that | 01/01/70 00:00 | |
Hw variants or debugging are big users of conditionals | 01/01/70 00:00 |