SPIM_1INT: //Place additional SPIM interrupt level processing here push a push x call bSPIM_1_ReadStatus ;wait for SPIM done, rather than buffer empty ;because of taking FLM low, after all the data has gone and a,(SPIM_SPI_COMPLETE) jz SPIM_EXIT //Have we transmitted five bytes? //(One from C call and four continuing from there) mov a,[_cByteCount] jnz SPIM1 //At this point all 30 bits have been shifted out, so clear FLM //and reg[PRT0DR],0feh //FLM must be high during LP //So, set request or [_cStatus],02h jmp SPIM_EXIT SPIM1: //Decrement count dec [_cByteCount] mov x,[_RAMpnt+1] //Fetch address in matrix from least sign. Byte mov a,[x+0] //Fetch data from address // mov a,0ffh call SPIM_1_SendTxData inc [_RAMpnt+1] //Although this is a two-byte address //it is an address in RAM so it can never be greater than 0xff SPIM_EXIT: pop x pop a reti