Баг или фича с #asm после if в PICC-18 STD 9.51PL1?
Пользую: MPLAB IDE v8.10, HI-TECH PICC-18 STD Release Notes for Version 9.51PL1, chip=18F258
Пример1 (asm вставляется в if):
main.c:
#include <pic18.h>
near unsigned char test;
void main(void)
{
if (test!=0) test=0x55;
#asm
movlw 0AAh
movwf _test,c
#endasm
LATC=test;
}
Listing:
_main:
; errata NOP at function entry point
dw 65535
;tst.c: 5: if (test!=0) test=0x55;
movf _test,w,c
bz l2
movlw 85
movwf _test,c
movlw 170 ;#
movwf _test,c;#
l2:
;tst.c: 10: LATC=test;
movff _test,3979 ;volatile
;tst.c: 11: }
goto start
Пример2 (добален только ";" и asm вставляется уже после if):
#include <pic18.h>
near unsigned char test;
void main(void)
{
if (test!=0) test=0x55;;
#asm
movlw 0AAh
movwf _test,c
#endasm
LATC=test;
}
Listing:
_main:
; errata NOP at function entry point
dw 65535
;tst.c: 5: if (test!=0) test=0x55;;
movf _test,w,c
bz l2
movlw 85
movwf _test,c
l2:
movlw 170 ;#
movwf _test,c;#
;tst.c: 10: LATC=test;
movff _test,3979 ;volatile
;tst.c: 11: }
goto start
Есть ли какой стандарт на данную тему?