This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

assembly interrupt

Hello how can i make this routine in assembly or how can i remove the PUSH an POP instructions for this routine run faster

C code:

void timer0 (void) interrupt 1
{
	samples[samplecount]=P3;
	samplecount++;
}

Assembly generated:
                 timer0:
C:0x8EB4    C0E0     PUSH     ACC(0xE0)
C:0x8EB6    C083     PUSH     DPH(0x83)
C:0x8EB8    C082     PUSH     DPL(0x82)
C:0x8EBA    C0D0     PUSH     PSW(0xD0)
C:0x8EBC    74AE     MOV      A,#0xAE
C:0x8EBE    2508     ADD      A,samplecount(0x08)
C:0x8EC0    F582     MOV      DPL(0x82),A
C:0x8EC2    E4       CLR      A
C:0x8EC3    34C2     ADDC     A,#0xC2
C:0x8EC5    F583     MOV      DPH(0x83),A
C:0x8EC7    E5B0     MOV      A,P3(0xB0)
C:0x8EC9    F0       MOVX     @DPTR,A
C:0x8ECA    0508     INC      samplecount(0x08)
C:0x8ECC    D0D0     POP      PSW(0xD0)
C:0x8ECE    D082     POP      DPL(0x82)
C:0x8ED0    D083     POP      DPH(0x83)
C:0x8ED2    D0E0     POP      ACC(0xE0)
C:0x8ED4    32       RETI

0