void main() {
TRISB = 0xFF;
TRISD = 0x00;
PORTD = 0x00;
do{
if (PORTB.F0 = 0)
PORTD.F0 = 1;
else
{PORTD.F0 = 0;}
}while (1);
}
void turnOnB3(void){
PORTB.B3 = 1;
}
int sumF(unsigned char a, unsigned char b){
return (a+b);
}
// Main code here
void main(void){
//Initialization code here
turnOnB3(); //This does the work of turning on RB3 but doesn not return anything
x = 5;
y = 9;
c = sumF(x,y); //This now calls the function that does the work of adding x and y and then returns the sum and is assigned to variable c
}
[i]type function_name(parameter-declarator-list);[/i]
[i]function_name(expression_1, ... , expression_n)[/i]
i want to program in assembler in mikroC, but how can i refer to registers by address? this is not so much a problem for special registers, i can just say clrf portb; but this is a problem for general registers with no namehow do i define them or how can i refer to a register by address?? this does not work clrf 0x21;
The mikroC PRO for PIC allows embedding assembly in the source code by means of the asm declaration. The declarations _asm and __asm are also allowed in the mikroC PRO for PIC and have the same meaning.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?