Please i need help on shortening the execution time of the code or reduce the memory usage to improve the performance. currently the code has this as the results of the memory used but i want to reduce it and also change some instruction sets to shorten execution. pls what can i do ?
Total Read Only Size (Code +RO Data)
36(0.04kilobytes)
Total Read/Write size (Read/write data +Zero initialized data)
0(0.00kilobytes)
Total ROM Size (code +RO+RW)
; Calculation of a factorial value using a simple loop
; set up the exception addresses THUMB AREA RESET, CODE, READONLY EXPORT __Vectors EXPORT Reset_Handler__Vectors DCD 0x00180000 ; top of the stack DCD Reset_Handler ; reset vector - where the program starts
AREA Task2a_Code, CODE, READONLYReset_Handler ENTRYstart MOV r1,#0 ; count the number of multiplications performed MOV r2,#3 ; the final value in the factorial calculation MOV r3,#1 ; the factorial result will be stored here
; loop r2 times forming the product fact ADD r1,r1,#1 ; find the next multiplicand MUL r3,r1,r3 ; form the next product - note that MUL r3,r3,r1 gives unpredictable output CMP r1,r2 ; check if the final value has been reached BMI fact ; continue if all products have not been formed exit ; stay in an endless loop B exit END