When I am compiling the following Assembly Language Code, I am getting the below error:
AREA mydata, DATA
COUNT EQU 10 SUM EQU 0
AREA mycode, CODE
ENTRY EXPORT __main
__main LDR r0, =COUNT LDR r1, =SUM LDR r2, =1
myLoop ADD r1, r2, r1 ADD r2, r2, #1 SUBS r4, r0, r2
BNE myLoop ADD r1, r2, r1
stop B stop
END
-----------------------------------------------------------------------------------
*** Using Compiler 'V5.06 update 4 (build 422)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Build target 'STM32L011D' assembling ASM_Sum.s... ASM_Sum.s(18): error: A1859E: Flag preserving form of this instruction not available ".\Objects\ARM_AL1.axf" - 1 Error(s), 0 Warning(s). Target not created. Build Time Elapsed: 00:00:00
I tried using ADDS instead of ADD for R2,R2,#1 in Keil v 5.0 and BINGO!!