| ??? 01/29/03 14:17 Read: times |
#37652 - RE: register protection in 8051 |
in the code, i am incrementing the register r5. say, it is first initialised to zero.then i am pushing to the stack. i 'll increment it inside the interrupt loop. so, now if i pop it again, then will it be initilaised again to zero value?
1) Get rid of whatever is in your head re interrupts and push and pop it is wrong. 2) When entering an interrupt service routine (ISR) a) ALWAYS push the PSW b) push a, b, dph and dpl if they are used in the ISR. In the ISR anything you need to be the same when the ISR is entered again MUST be global variables. (Others, please do not argue about local permanent variables - it is beyond the scope of this) When exiting the ISR pop what you pushed on entry in reverse order. Erik |
| Topic | Author | Date |
| register protection in 8051 | 01/01/70 00:00 | |
RE: register protection in 8051 | 01/01/70 00:00 | |
| RE: register protection in 8051 | 01/01/70 00:00 | |
| RE: register protection in 8051 | 01/01/70 00:00 | |
| RE: register protection in 8051 | 01/01/70 00:00 | |
| RE: register protection in 8051 | 01/01/70 00:00 | |
| RE: register protection in 8051 | 01/01/70 00:00 | |
| RE: register protection in 8051 | 01/01/70 00:00 | |
| RE: register protection in 8051 | 01/01/70 00:00 | |
| RE: register protection in 8051 | 01/01/70 00:00 | |
| RE: register protection in 8051 | 01/01/70 00:00 | |
| RE: register protection in 8051 | 01/01/70 00:00 | |
| RE: register protection in 8051 | 01/01/70 00:00 |



