avrage in assembly languege

Status
Not open for further replies.

abdulQ8

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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…