I'm using microchip version v8.63 with C compiler.
The following piece of code, I want to 'shift once the value 1206420333240d', I know that the 1 bit comes in the carry register. But I don't know how to retrieve this values in assembly language for the pic18F4550. My question is, how can I shift once with assembler for the pic 18F4550 and get the value from the carry?
In included the whole project.
unsigned int rood = 1206420333240;
void main (void)
{
//int rood[] = {0,0,1,0,1,0,1,0,1,0,1,1,1,0,0,0,0,1,1,0,1,0,1,0,1,0,0,0,1,1,0,1,1,1,0,1,0,1,0,1,0,0,0,1,1};
TRISD = 0x00; // PORTD als output
TRISB = 0b00110000; // RB4 en RB5 als input
TRISA = 0x00; // RA output
RCONbits.IPEN = 0; // prioriteit disable
INTCONbits.GIE = 1; // enable interrupt
INTCONbits.RBIE = 1; // interrupt portB on
while(1)
{
_asm sleep _endasm
}
}
#pragma interrupt ISR
void ISR (void)
{
if (INTCONbits.RBIF==1)
{
if(PORTBbits.RB5==0) // S3 pressed ?
{
int i = 0;
int b;
do {
// Try to shift left (SHF) and get value in carry.
_asm
mov EAX, 1206420333240d
_endasm
//LATAbits.LATA2 = rood << 1;
//LATDbits.LATD1 ^= 1;
//do-while for the frequentie (1500 is de freq)
b = 0;
do {
b++;
}while(b <= 2000);
i++;
}while(sizeof(rood) <= 50);
//LATDbits.LATD1 ^= 1; // D2 togglen
}
}
INTCONbits.RBIF = 0;
}