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.

avrage in assembly languege

Status
Not open for further replies.

abdulQ8

Newbie level 4
Newbie level 4
Joined
Feb 22, 2009
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,312
finding the average in asm

how to find the average of three variable
in assembly language
for example

R10=median(R1,R2,R3)
can anyone help me in the assembly code plz
thanx in advanced
 

what cpu do you need the code for?

Are your variables (double) integer, floating or fixed point?

Essentially its just

Add R1 to R2,
Add R3 to result,
Divide by three.

implementation will be dependent on what CPU you use, whether you wish for it to be a function call or inline and whether you wish for a fixed length of variables or dynamic length.
 

Assembly language memnonics are different for different CPU's
Common Microcontroller CPU's are PIC and AVR, but could be anything else. Assembly language for just these two reads quite different and won't work on each other.
 

Even the assembly language is different for 8051 and 8085, 8086 which are designed by same firm Intel...
Specify the CPU or microcontroller you are using...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top