Question: . syntax unified . cpu cortex - m 3 AREA . text, CODE, READONLY . equ SVC _ NUM, 0 0 6 / / 0

.syntax unified
.cpu cortex-m3
AREA .text, CODE, READONLY
.equ SVC_NUM, 006//006 is the last 3 digit of BITS ID
.thumb
.global SVC_Handler
SVC_Handler
TST lr, #4
ITE EQ
MRSEQ r0, MSP // Correct register names
MRSNE r0, PSP
MOV r1, r0// R1 holds the address of the SVC instruction
LDRB r0,[r1, #-2]// Load the SVC instruction
AND r0, r0, #0xFF // Mask to extract the SVC number
CMP r0, #SVC_NUM
BNE not_matched
// SVC number matches BITS ID, perform addition
LDR r2,=84006// BITS ID last 5 digits
LDR r3,=84006// BITS ID last 5 digits
ADD r0, r2, r3// Perform addition
B svc_done
not_matched
// SVC number doesn't match BITS ID, perform subtraction
LDR r2,=84006// BITS ID last 5 digits
LDR r3,=84006// BITS ID last 5 digits
SUB r0, r2, r3// Perform subtraction
svc_done
// Return from SVC handler, restoring original stack and returning to application
TST lr, #4
ITE EQ
MRSEQ r1, MSP
MRSNE r1, PSP
LDMIA r1!,{r0-r3}// Restore context, note the use of lowercase registers
MOV lr, r3// Restore LR
BX lr // Return to the application
In the above code on ARM keil v5, i am gettng below 7 errors, Can you please help rectify these errors and provide me a error free code to run
*** Using Compiler 'V5.06 update 6(build 750)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'Target 1'
assembling Q3m1.s...
Q3m1.s(1): error: A1137E: Unexpected characters at end of line
Q3m1.s(2): error: A1137E: Unexpected characters at end of line
Q3m1.s(3): error: A1135E: Area name missing
Q3m1.s(4): error: A1137E: Unexpected characters at end of line
Q3m1.s(5): error: A1137E: Unexpected characters at end of line
Q3m1.s(6): error: A1137E: Unexpected characters at end of line
Q3m1.s(7): error: A1355U: A Label was found which was in no AREA
".\Objects\Q3m1.axf" -7 Error(s),0 Warning(s).
Target not created.
Build Time Elapsed: 00:00:00

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!