what changes to the source code of ARM Cortex-M3 can i make in order to shorten execution time?

here are the 3 codes i need to change to shorten execution time.

any help will be greatly appreciated.

5734.zip
Parents
  • I am a newbie to assembly language programming.

    I need to make a few changes to the code to to reduce execution time.

    I have have managed to replace LDRs with a single a single LDMIA.

    can any one point me in the right direction please.

    here is a sample of the code peterharris

      ; copy and process blocks of 8 words

    block_loop

      LDMIA r0!,{r5-r12}  ; get 8 words to copy as a block

      MOV r4,r5           ; get first item

      BL data_processing  ; process first item

      MOV r5,r4           ; keep first item

      MOV r4,r6           ; get second item

      BL data_processing  ; process second item

      MOV r6,r4           ; keep second item

      MOV r4,r7           ; get third item

      BL data_processing  ; process third item

      MOV r7,r4           ; keep third item 

      MOV r4,r8           ; get fourth item

      BL data_processing  ; process fourth item

      MOV r8,r4           ; keep fourth item

      MOV r4,r9           ; get fifth item

      BL data_processing  ; process fifth item

      MOV r9,r4           ; keep fifth item 

      MOV r4,r10          ; get sixth item

      BL data_processing  ; process sixth item

      MOV r10,r4       ; keep sixth item

      MOV r4,r11          ; get seventh item

      BL data_processing  ; process seventh item

      MOV r11,r4          ; keep seventh item

      MOV r4,r12          ; get eighth item

      BL data_processing  ; process eighth item

      MOV r12,r4          ; keep eighth item 

      STMIA r1!,{r5-r12}  ; copy the 8 words

      SUBS r3,r3,#1       ; move on to the next block

      BNE block_loop      ; continue until last block reached

    PLEASE HELP!

Reply
  • I am a newbie to assembly language programming.

    I need to make a few changes to the code to to reduce execution time.

    I have have managed to replace LDRs with a single a single LDMIA.

    can any one point me in the right direction please.

    here is a sample of the code peterharris

      ; copy and process blocks of 8 words

    block_loop

      LDMIA r0!,{r5-r12}  ; get 8 words to copy as a block

      MOV r4,r5           ; get first item

      BL data_processing  ; process first item

      MOV r5,r4           ; keep first item

      MOV r4,r6           ; get second item

      BL data_processing  ; process second item

      MOV r6,r4           ; keep second item

      MOV r4,r7           ; get third item

      BL data_processing  ; process third item

      MOV r7,r4           ; keep third item 

      MOV r4,r8           ; get fourth item

      BL data_processing  ; process fourth item

      MOV r8,r4           ; keep fourth item

      MOV r4,r9           ; get fifth item

      BL data_processing  ; process fifth item

      MOV r9,r4           ; keep fifth item 

      MOV r4,r10          ; get sixth item

      BL data_processing  ; process sixth item

      MOV r10,r4       ; keep sixth item

      MOV r4,r11          ; get seventh item

      BL data_processing  ; process seventh item

      MOV r11,r4          ; keep seventh item

      MOV r4,r12          ; get eighth item

      BL data_processing  ; process eighth item

      MOV r12,r4          ; keep eighth item 

      STMIA r1!,{r5-r12}  ; copy the 8 words

      SUBS r3,r3,#1       ; move on to the next block

      BNE block_loop      ; continue until last block reached

    PLEASE HELP!

Children
More questions in this forum