Видимо мне не повезло и все были в отпуске.
Видимо мне не повезло и все были в отпуске.
Код: Выделить всё
\ _interrupt_14:
\ 000000 8A PUSH CC
\ 000001 84 POP A
\ 000002 A4 BF AND A, #0xbf
\ 000004 88 PUSH A
\ 000005 86 POP CC
\ 000006 3B .... PUSH S:?b3
\ 000009 3B .... PUSH S:?b2
\ 00000C 3B .... PUSH S:?b1
\ 00000F 3B .... PUSH S:?b0
\ 000012 3B .... PUSH S:?b7
\ 000015 3B .... PUSH S:?b6
\ 000018 3B .... PUSH S:?b5
\ 00001B 3B .... PUSH S:?b4Код: Выделить всё
For example:
#include <iostm8s208mb.h>
#pragma vector = UART1_R_RXNE_vector /* Symbol from I/O */
__interrupt void MyInterruptRoutine(void)
{ /* Do something */}
Код: Выделить всё
_EXTI_PORTA_IRQHandler:
; EXTI_PORTA_IRQHandler.c: 53: }
iret
Что интересно, SDCC в этом случае поступает оригинальней, вставляя командуUnexpected DIV/DIVW instruction result in ISR
Description
In very specific conditions, a DIV/DIVW instruction may return a false result when executed inside an interrupt service routine (ISR). This error occurs when the DIV/DIVW instruction is interrupted and a second interrupt is generated during the execution of the IRET instruction of the first ISR. Under these conditions, the DIV/DIVW instruction executed inside the second ISR, including function calls, may return an unexpected result.The applications that do not use the DIV/DIVW instruction within ISRs are not impacted.
Workaround
If an ISR or a function called by this routine contains a division operation, the following assembly code should be added inside the ISR before the DIV/DIVW instruction:
push cc
pop a
and a,#$BF
push a
pop cc
This sequence should be placed by C compilers at the beginning of the ISR using DIV/DIVW. The user can refer to the compiler documentation for details on the implementation and control of automatic or manual code insertion.