Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

assembly language program

Status
Not open for further replies.

cai2

Member level 2
Joined
Nov 30, 2006
Messages
50
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,618
please help me with this problem. To write an assembly program that adds two positive 5 digit numbers. Assume that the user will enter only up to 5-digit numbers. Then, the program will ask the user to enter two numbers and then the program proceeds to compute and display the sum. Thanks!!!!!!:cry:
 

Eugen_E

Full Member level 6
Joined
Nov 29, 2004
Messages
382
Helped
44
Reputation
86
Reaction score
11
Trophy points
1,298
Location
Romania
Activity points
2,838
Please tell what type of microcontroller you use.
 

gamana

Newbie level 3
Joined
Dec 3, 2006
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,299
Assembly language programs are processor specific. So u have to mention the micrcontroller, for which u want to code. To over come this problem, High level language like C is used to program microcontrollers. It is called Embedded C.
 

Sadegh.j

Advanced Member level 3
Joined
Nov 29, 2006
Messages
754
Helped
48
Reputation
98
Reaction score
15
Trophy points
1,298
Activity points
5,596
You can easily write a C code and use an appropriate compiler.
Problem: size
 

the_risk_master

Advanced Member level 2
Joined
Aug 12, 2005
Messages
662
Helped
79
Reputation
158
Reaction score
19
Trophy points
1,298
Location
UE+MIT, Philippines, (14°N , 120°E )
Activity points
5,527
Hi caicai,

Your problem seem too easy, but too difficult to answer if you are not specific.

anyway, here's an assembly code (in 8085 microprocessor) as a sample

MVI A, 04h ; store value 04h at regA
MVI B, 05h ; store value 05h at regB
ADD B, A ; add A and B, result-->A
STA 002Fh ; store accumulator (regA) to memloc 002F
OUT A ; output values stored at regA
HLT ; program halt
 

cai2

Member level 2
Joined
Nov 30, 2006
Messages
50
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,618
an 8086...
 

cai2

Member level 2
Joined
Nov 30, 2006
Messages
50
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,618
an 8086 controller

Added after 7 minutes:

i mean processor....
 

vijaya_narayana

Full Member level 3
Joined
Jun 12, 2007
Messages
172
Helped
11
Reputation
22
Reaction score
1
Trophy points
1,298
Location
India
Activity points
2,158
try be controller specific then only we can come out with code
 

cai2

Member level 2
Joined
Nov 30, 2006
Messages
50
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,618
I've made a mistake its an 8051 microcontroller...
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top