Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Different AREA directive in ARM processor ...

Status
Not open for further replies.

akshatra

Newbie level 2
Newbie level 2
Joined
Apr 23, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,322
Hi all,

I am making some small programs in ARM assembly language.

I am using KEIL software for the programming and compialtion.

The problem I am facing is during a program in which data form one memory is copied to another memory.

The example I am following is given in the help file with KEIL uvision.

The Program is as follows :

=====================================================

AREA Word, CODE, READONLY ; name this block of code

num EQU 20 ; set number of words to be copied

ENTRY ; mark the first instruction called

EXPORT __main
__main
LDR r0, =src ; r0 = pointer to source block
LDR r1, =dst ; r1 = pointer to destination block
MOV r2, #num ; r2 = number of words to copy
wordcopy
LDR r3, [r0], #4 ; load a word from the source and
STR r3, [r1], #4 ; store it to the destination
SUBS r2, r2, #1 ; decrement the counter
BNE wordcopy ; ... copy more
stop
MOV r0, #0x18 ; angel_SWIreason_ReportException
LDR r1, =0x20026 ; ADP_Stopped_ApplicationExit
SVC #0x123456 ; ARM semihosting (formerly SWI)

AREA BlockData, DATA, READWRITE
src DCD 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4
dst DCD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
END

=====================================================

The Problem is data is not copied in the destination address nor I can read the data from the source.

As I am using KEIL so there is Startup.s file and I have commented the last part in the file which is :

=====================================================

; Enter the C code

IMPORT __main
LDR R0, =__main
BX R0


; IF :DEF:__MICROLIB
;
; EXPORT __heap_base
; EXPORT __heap_limit

; ELSE
; User Initial Stack & Heap
; AREA |.text|, CODE, READONLY

; IMPORT __use_two_region_memory
; EXPORT __user_initial_stackheap
;__user_initial_stackheap

; LDR R0, = Heap_Mem
; LDR R1, =(Stack_Mem + USR_Stack_Size)
; LDR R2, = (Heap_Mem + Heap_Size)
; LDR R3, = Stack_Mem
; BX LR
; ENDIF

=====================================================

and thats why I had used EXPORT __main in the starting of the progam.

Could any one please tell me what the problem is and where I am doing the mistakes.
As I am new to arm assembly ... so cant figure it out

regards
Arvind
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top