Using assembly code

  Simple example of changes to typical heartbeat timer irq inline assembly Original C18 Code _asm //Reset timer for next rollover movff TMR0L,uc_asm_irq_temp //read_current_timer_value (read low byte loads high byte) movff TMR0H,uc_asm_irq_temp1 movlw 0xbb addwf uc_asm_irq_temp,1,0 //(1 = file register, 0 = access ram) movlw 0x3c addwfc uc_asm_irq_temp1,1,0 //(1 = file register, 0 = access ram) […]

Read More

Interrupt Functions

Old C18 Code //********************************************** //********** HIGH PRIORITY INTERRUPTS ********** //********************************************** #pragma code highVector=0x08 void athighvector (void) { _asm GOTO interruptisrh _endasm } #pragma code //********************************************* //********** LOW PRIORITY INTERRUPTS ********** //********************************************* #pragma code lowVector=0x18 void atlowvector (void) { _asm goto interruptisrl _endasm } #pragma code // give back code control New XC8 Code Dont' bother […]

Read More

Assembler variables to be located in access ram

Old C18 code //Inline assembler access bank variables #pragma udata access acssect // "acssect" is the section label near unsigned char uc_asm_irq_temp; // near qualifier specifies access RAM near unsigned char uc_asm_irq_temp1; #pragma udata New XC8 Code //Inline assembler access bank variables near static unsigned char uc_asm_irq_temp; // near qualifier specifies access RAM near static […]

Read More