| ??? 08/11/02 18:52 Read: times |
#27079 - RE: stack overflow problem |
init:
setb 0afh setb 0a9h ; Interrupt enable SFR setb 0b9h ; Interrupt priority SFR and clr 8ch .... setb 8ch What are you trying to accomplish with this code? If you wish to modify certain bits within an SFR you need to specify the character location or the SFR name. For instance, Interrupt Enable control or IE is at memory location 0A8h. The enable bit for Timer0 is at IE.1, also known as ET0 (ET zero). So, to enable Timer0 interrupt you would use the code line; SETB ET0 or SETB IE.1 As for your line; mov 81h, #34h ; this seems to solve the problem all you are doing is setting the Stack Pointer to 34h. This is not good. You need to place a RETI instruction at the end of your TIMER routine. When an interrupt occurs the CPU PUSHES the current PC value onto the stack, then sends control to your ISR (intrrupt service routine) or TIMER in your case. The RETI at the end causes the CPU to POP the Stack and returns your program back to where it was interrupted. Without RETI your stack will overflow very quickly. I would suggest reviewing the section on SFR's and Interrupt in the TUTORIALS here at your left. Good luck Hal |
| Topic | Author | Date |
| stack overflow problem | 01/01/70 00:00 | |
| RE: stack overflow problem | 01/01/70 00:00 | |
| RE: stack overflow problem | 01/01/70 00:00 | |
| RE: stack overflow problem | 01/01/70 00:00 | |
| RE: stack overflow problem | 01/01/70 00:00 | |
Thank You!! | 01/01/70 00:00 |



