| ??? 06/25/99 15:58 Read: times |
#530 - Stack and interrupts |
enable timer0 interrupt
55h: jnb ri,$ when tf0 is set then an interrupt occurs and program jump in vector 000Bh after the reti the program will jump of course at 55h. Sometimes this is bad. I try a trick to avoid this situation...and i test it with a simulator (it works correctly) but i don't know if this works in a real situation .The code is below ...could anyone with practical experience tell me his opinion..Thanks __________________________ ORG 0000H JMP MAIN ORG 0023H JMP RECEIVE MAIN: MOV SP,#07FH MOV SCON,#50H MOV TMOD,#00100000B MOV TH1,#0D0H ORL PCON,#80H MOV IE,#10010000B SETB TR1 CLR RI WAIT: JMP WAIT RECEIVE: MOV dptr,#3040H PUSH 82h ;DPL PUSH 83H ;DPH MOV A,SBUF MOV P1,a clr ri RETI ORG 3040H mov p1,10101010b LJMP 0000h without this instructions mov dptr,#3040h and push 82h, push 83h after the reti the programm returs in loop: wait: jmp wait |
| Topic | Author | Date |
| Stack and interrupts | 01/01/70 00:00 | |
| RE: Stack and interrupts | 01/01/70 00:00 | |
| RE: Stack and interrupts | 01/01/70 00:00 | |
| RE: Stack and interrupts | 01/01/70 00:00 | |
RE: Stack and interrupts | 01/01/70 00:00 |



