Question: . syntax unified . cpu cortex - m 3 AREA | . text | , CODE, READONLY ; Define an area named ' . text'
syntax unified
cpu cortexm
AREA text CODE, READONLY ; Define an area named text'
SVCNUM EQU ; Define SVCNUM as
; Define the SVCHandler as a global symbol
THUMB
EXPORT SVCHandler
SVCHandler
TST lr # ; Test whether LR indicates MSP or PSP
ITE EQ
MRSEQ r msp ; If EQ set r to MSP
MRSNE r psp ; If not EQ set r to PSP
MOV r r ; Copy the stack pointer to r
LDRB rr # ; Load the SVC instruction
AND r r #xFF ; Mask to extract the SVC number
CMP r #SVCNUM ; Compare with SVCNUM
BNE notmatched ; Branch if not equal to SVCNUM
; SVC number matches BITS ID perform addition
LDR r ; Load BITS ID last digits
LDR r ; Load BITS ID last digits
ADD r r r ; Perform addition
B svcdone ; Branch to svcdone
notmatched
; SVC number doesn't match BITS ID perform subtraction
LDR r ; Load BITS ID last digits
LDR r ; Load BITS ID last digits
SUB r r r ; Perform subtraction
svcdone
; Return from SVC handler, restoring original stack and returning to application
TST lr # ; Test whether LR indicates MSP or PSP
ITE EQ
MRSEQ r msp ; If EQ set r to MSP
MRSNE r psp ; If not EQ set r to PSP
LDMIA rrr ; Restore context
MOV lr r ; Restore LR
BX lr ; Return to the application
Above code in ARM is throwing errors as below, Unable to rectify, I am using ARM Architecture and LPC from nxp on Keil version. Please help resolve the errors so tha i can run the program
Error Message as below
Using Compiler V update build folder: C:KeilvARMARMCCBin
Rebuild target 'Target
assembling Qs
Qs: error: AE: Unexpected characters at end of line
Qs: error: AE: Unexpected characters at end of line
Qs: error: AE: Unknown opcode text expecting opcode or Macro
Qs: error: AU: A Label was found which was in no AREA
ObjectsQaxf" Errors Warnings
Target not created.
Build Time Elapsed: ::
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
