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.

Arm assembly language

Status
Not open for further replies.

ratan22

Newbie level 6
Joined
Apr 3, 2018
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
BHUBAMESWAR
Activity points
131
I do a program in assembly language of lpc2148 arm microcontroller, i want to start my program memory location of 0x0400 how to start it and that time which directive i will be used i don't know
plese help me
 

Hi,

Did you go through a basic ARM assembler tutorial?
Doesn't the hardware vendor or software (assembler) vendor give example programs?
And LP2148 datasheet (maybe there are a couple of datasheets) should also give you this information.
There should be very simple code examples in the internet where you can see the basic setup.
This are the sources where I'd try to find the answers, because this is equal with all microcontrollers.

*******
Please tell us what's the exact software you use.
Show us your code - even if it does not work, even if it's just a couple of lines
Give the sources of informations you use.
Do you use a simulator?

Klaus
 

yes sir i use keil software, and i use instruction-
"AREAPROGRAM, CODE, READONLY" after this line program will start but prolem is it take by difault memory location (0x0000) program
;; so i want to my program start after 0x0400 memory location
Code:
MY PROGRAM-
;;**************************it is lcd program************
IO0DIR		EQU		0XE0028008
IO0SET		EQU		0XE0028004
IO0CLR		EQU		0XE002800C
IO0PIN 		EQU		0XE0028000
IO1DIR		EQU		0XE0028018
IO1SET		EQU		0XE0028014
IO1CLR		EQU		0XE002801C
IO1PIN		EQU		0XE0028010
PINSEL0		EQU		0XE002C000
PINSEL2		EQU		0XE002C014 
PCONP		EQU		0XE01FC0C4 
 AREA		PROGRAM, CODE, READONLY	;;;after this line program will start
								;; it take by difault memory location (0x0000) program srart 
			BL		DELAY				  
		;;	BL		DELA
	 		MOV	 	R2,#0X1C00000
			LDR		R3,=IO1DIR
 			STR		R2,[R3]
			LDR		R3,=PINSEL2
			MOV		R2,#0X00000000
			STR		R2,[R3]
			MOV		R2,#0X3C00
			LDR		R3,=IO0DIR
			STR		R2,[R3]
			LDR		R3,=PINSEL0
			MOV		R2,#00000000
			STR		R2,[R3]
			LDR		R7, =DATA1
			LDR		R8, =DATA2
LOOPP		LDR		R3,=IO0PIN
			LDRB	R0,	  [R7]
			CMP		R0,#0X00
			BNE		STY
			B		NEXT
STY			AND		R0,R0,#0X0F
			MOV		R0,R0,ROR #22
			STR		R0,[R3]
			BL		CMD
			BL		DELAY
			LDR		R3,=IO0PIN
			LDRB	R0,   [R7], #1
			MOV		R0,R0,ROR #4
			AND		R0,R0,#0X0000000F
			MOV		R0,R0,ROR #22
			STR		R0,[R3]
			BL		CMD
			BL		DELAY
			B		LOOPP
NEXT		LDR		R3,=IO0PIN
			LDRB	R0,	  [R8]
			CMP		R0,#0X00
			BNE		STY1
			B		NEXT1
STY1		AND		R0,R0,#0X0F0
			MOV		R0,R0,ROR #26
			STR		R0,[R3]
			BL		DAT
			BL		DELAY
			LDR		R3,=IO0PIN
			LDRB	R0,   [R8], #1
			AND		R0,R0,#0X0000000F
			MOV		R0,R0,ROR #22
			STR		R0,[R3]
			BL		DAT
			BL		DELAY
			B		NEXT
NEXT1		B		NEXT1
DAT
 			MOV		R2,#0X1400000
			LDR		R3,=IO1PIN
			STR		R2,[R3]
			MOV		SP,LR
			BL		DELAY
			MOV		R2,#0X000000
			LDR		R3,=IO1PIN
			STR		R2,[R3]
			MOV		LR,SP
			MOV		PC,LR
CMD
			MOV		R2,#0X0400000
			LDR		R3,=IO1PIN
			STR		R2,[R3]
			MOV		SP,LR
			BL		DELAY
			MOV		R2,#0X000000
			LDR		R3,=IO1PIN
			STR		R2,[R3]
			MOV		LR,SP
			MOV		PC,LR
DELAY
			MOV		R5,#0X2
UP13		MOV		R4,#0x0002
UP11		MOV		R6,#0x008F
UP			SUBS	R6,R6,#0X1
			BNE		UP
			SUBS	R4,R4,#0X1
			BNE		UP11
			SUBS	R5,R5,#0X1
			BNE		UP13
			MOV		PC,LR

 			AREA		TABLE1,	READONLY
DATA1		DCB		0X23,0X82,0XE0,0X60,0X10,0X08,0X00

 			AREA		TABLE2,  READONLY
DATA2		DCB		"NI INNOVATION",0X00
		
       		END
 

memory.png It is the memory window of this program
 

The discussion seems to jump too short. To understand what's going on at program start, you should read a bit about LPC2148 boot loader, memory mapping modes, interrupt vectors.

Or alternatively, follow a tutorial for "my first assembly program".
 

what such terrible should happen in life to convince you start using asm with arm?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top