??? 06/22/05 05:59 Read: times |
#95550 - reset (all the time) Responding to: ???'s previous message |
In other words: END is not an 8052 instruction. It's only to tell your ASSEMBLER (the PC program) that it should stop right there reading your text file, the source code. It is not translated into the final product, the object code.
Like EQU, DB and ORG, END is a pseudo-opcode or directive, used for formatting your text and control of your assembler program. If you look at an 8052 instruction set summary, and you should!!!, you will find that an 8052 has instructions like MOV and LJMP, but not END! To end your program, you should do either of these things: 1) End with a tight loop, like ENDLOOP: SJMP ENDLOOP so your CPU will have something to do for the rest of eternity or 2) Set the idle or power down bit in the PCON sfr in a tight loop, like ENDLOOP: MOV PCON,#1 SJMP ENDLOOP Option 2 saves some energy as it switches off your CPU. The reason why you would still use a loop there (technically, it would be enough to load PCON once and then consider the CPU dead) is that the CPU might still wake up after the load because of interrupts, if enabled. |
Topic | Author | Date |
reset (all the time) | 01/01/70 00:00 | |
complete loop | 01/01/70 00:00 | |
reset (all the time) | 01/01/70 00:00 | |
Further explanation | 01/01/70 00:00 | |
reset (all the time) | 01/01/70 00:00 | |
Loop is not ok. | 01/01/70 00:00 | |
exit to where?![]() | 01/01/70 00:00 | |
Run amuk | 01/01/70 00:00 |