News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

sorting programming

Started by dungeonfinder, October 26, 2013, 01:41:31 PM

Previous topic - Next topic

dedndave

oops - what if the array is 65535 bytes ?   :biggrin:
or 32769 to 65535, for that matter

JBE would work if DEC set the carry flag

probably the best code would be...
        sub     cx,1
        jbe     BSort4

Gunther

Dave,

Quote from: dedndave on November 04, 2013, 05:27:02 AM
JBE would work if DEC set the carry flag

that won't work. Here's the explanation.

Gunther
You have to know the facts before you can distort them.

dedndave

right - that's why i suggested SUB CX,1

Gunther

Dave,

Quote from: dedndave on November 04, 2013, 07:41:17 AM
right - that's why i suggested SUB CX,1

So we are on the safe side.

Gunther
You have to know the facts before you can distort them.

jj2007

Quote from: dedndave on November 04, 2013, 05:27:02 AM
oops - what if the array is 65535 bytes ?   :biggrin:
or 32769 to 65535, for that matter

Quote from: dungeonfinder on October 26, 2013, 01:41:31 PM
   MSG1 DB "How many integers would you like to enter? (Please enter from 2 to F)", "$"

0fh aka 15 is way below 32769...

dedndave

ok - but the routine was intended to be more generic   :P
you probably knew that - lol

jj2007

Quote from: dedndave on November 04, 2013, 10:13:11 AM
you probably knew that - lol

I would never expect an array with more than 32768 members if total memory was only 640k ;-)

dedndave

you're kidding, right ?
i used arrays larger than 64 kb sometimes