Thank you very much for the help from both of you. The idea of using the "jr" instruction seemed to me to be a simple and ingenious solution to my problem. Unfortunately, it turned out that in this case the problem is more complicated.
I am trying to output data to a VGA monitor from a CH32V003. I thought I would proceed as follows:
1) The processor runs at a frequency of 48 MHz.
2) I will start the TIM1 timer with a period of about 1500 pulses without a prescaler.
3) Using CC1, I will make a PWM output for automatic generation of a horizontal synchro pulse.
4) In the TIM1_UP interrupt, the lines will be counted and after 525 lines a software vertical pulse will be made.
5) Using CC2, which will generate the TIM_IT_CC2 interrupt, I will start a DMA transfer at the right moment during the line.
6) The DMA channel will fulfill the SPI, which will make a video signal on the MOSI output. The SPI frequency is divided by 4 (12 MHz).
I managed to get everything up and running fine, but I noticed that some lines on the screen were slightly shifted to the right (about 1 pixel). Since I had an empty main loop, I assumed it was a longer jump instruction that always had to be completed. I tried adding different numbers of NOPs to the main loop. The shifted lines really changed based on this.
Unfortunately, I found out that the problem is more complicated. The CPHA and CPOL settings also affect the line shift. The divider in SPI is probably always running. It depends on the moment when data is written to the data register. Then the clock phase for sending data must come. I probably can't reset the divider, so the moment of data insertion and data output from MOSI may be slightly out of sync. I probably won't fix this.

Anyway, thanks again for your help.