![]() |
tasm sorting 5 integers with array
iv been trying to code this but everytime i run the program it wont sort or it wont swap, can someone at least give me an example with sorting 5 integers using array, so that i will use this as my reference for my project,my project is that to sort names in alpabetical order,
|
Re: tasm sorting 5 integers with array
Well, we can't tell what is wrong with your program, unless we're mind readers, because you haven't provided any code for us to look at.
No, we won't write your code for you. We will help you with what you write. You have joined our community and asked for free help. I perceive that you have not read our rules. That seems rather rude, does it not? |
Re: tasm sorting 5 integers with array
oh im realy sory heres my code for sorting 5 integers using array, its not finish yet im still testing for the first and second index to swap
:
extrn readnum:near |
Re: tasm sorting 5 integers with array
Notice here:
:
check:Have you tried stepping through this with a debugger? I highly recommend it. |
Re: tasm sorting 5 integers with array
ah ya im just a newbie at this, can you check this one this is my second attempt and can you advise me of wat gud books or site for assembly
:
extrn readnum:near |
Re: tasm sorting 5 integers with array
http://www.xs4all.nl/~smit/asm01001.htm
Honestly, you are a lot farther along than the tutorial is but more info can never hurt. |
Re: tasm sorting 5 integers with array
You're missing the point.
:
comp: |
Re: tasm sorting 5 integers with array
Re-read DaWei's post. Then try plotting out the logical flow before you write any further code. I'll give you an example using a bubble sort, since it's very easy to understand. It should look something like this:
:
set unsorted items = array size:
sort:As a final suggestion, I'd really advise you to comment your assembly code. It's not like a higher-level language where you can derive a lot of meaning from variable names and other constructs; poorly commented asm is damn near opaque when you come back to it later. |
Re: tasm sorting 5 integers with array
My guess is he's trying to accomplish an insertion sort.
|
Re: tasm sorting 5 integers with array
Quote:
That's my story, and I'm sticking to it. It's got nothing to do with me being a lazy ass, and not wanting to write something marginally more complex in assembly. :) |
| All times are GMT -5. The time now is 4:45 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC