In ASM, Linker don't recognize predefined globals variable such as PORTB if this variables is not initializated before.
http://www.mikroe.com/forum/viewtopic.php?p=65023#65023
For examples :
Code: Select all
asm
MOV RCOUNT,W12
end;
Code: Select all
asm
MOV PORTB,W12
end;
Work around :
Code: Select all
PORTB := PORTB; // skipped by optimizer
asm
MOV PORTB,W12
end;