Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Routine to get the Average of 5 numbers...? 2

Status
Not open for further replies.

CubeE101

Programmer
Nov 19, 2002
1,492
US
How can you use ASM to get the average of 5 integer numbers with values up to a BYTE in size... (0-255)

I know you can use Right Shift to Average 2,4,8,... numbers

I never realy grasped how DIV works in ASM, if someone could explain that i would also be greatful... (like what registers to put the Numerator and denominator, and where the results are returned...

Is there a faster way to Average odd sets of numbers than using divide?

sorry for my ignorence... It's been about 3 or 4 years since I coded in ASM and that didn't last too long...

ThnX N AdvnC

Have Fun, Be Young... Code BASIC
-Josh Stribling
cubee101.gif

 
Oops, all become italic. How ??? [surprise] [tongue]
Btw how can I edit the message that has been posted ?

Regards
 
...arrays...
what about with DEBUG?

>>Btw how can I edit the message that has been posted ?

I don't think you can in this forum...

fyi...
MaxCode's forum let's you edit your posts though...
...and add attachments, and the [code]bla[/code] looks better...

I use both of them... frequently...

Have Fun, Be Young... Code BASIC
-Josh Stribling
cubee101.gif

 
Yes I know in some forum they have the option to edit the posts. But I don't see it in this forum. Ok then I can live with it :)

...arrays...
what about with DEBUG?

You can do it with debug but of course in different ways. Arrays, pointers, whatever... is just a simple thing in asm. It's only a location (address) in memory.

Using DEBUG means we edit directly in memory. Honestly I don't know how can I explain this in simple way especially with debug. I suggest you do some simple test. Make small asm program and compile it. Then debug it to see how it works.

Other things is, in HLL they work differently with asm. different HLL sometimes also different on how they create arrays. So you have to know exactly how the HLL work with array first. Then you can code it in asm.

Good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top