Author Topic: sorting programming  (Read 9189 times)

dedndave

  • Member
  • *****
  • Posts: 8741
  • Still using Abacus 2.0
    • DednDave
Re: sorting programming
« Reply #15 on: November 04, 2013, 05:27:02 AM »
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...
Code: [Select]
        sub     cx,1
        jbe     BSort4

Gunther

  • Member
  • *****
  • Posts: 3515
  • Forgive your enemies, but never forget their names
Re: sorting programming
« Reply #16 on: November 04, 2013, 07:04:54 AM »
Dave,

JBE would work if DEC set the carry flag

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

Gunther
Get your facts first, and then you can distort them.

dedndave

  • Member
  • *****
  • Posts: 8741
  • Still using Abacus 2.0
    • DednDave
Re: sorting programming
« Reply #17 on: November 04, 2013, 07:41:17 AM »
right - that's why i suggested SUB CX,1

Gunther

  • Member
  • *****
  • Posts: 3515
  • Forgive your enemies, but never forget their names
Re: sorting programming
« Reply #18 on: November 04, 2013, 08:49:44 AM »
Dave,

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

So we are on the safe side.

Gunther
Get your facts first, and then you can distort them.

jj2007

  • Member
  • *****
  • Posts: 7633
  • Assembler is fun ;-)
    • MasmBasic
Re: sorting programming
« Reply #19 on: November 04, 2013, 09:34:02 AM »
oops - what if the array is 65535 bytes ?   :biggrin:
or 32769 to 65535, for that matter

   MSG1 DB "How many integers would you like to enter? (Please enter from 2 to F)", "$"

0fh aka 15 is way below 32769...

dedndave

  • Member
  • *****
  • Posts: 8741
  • Still using Abacus 2.0
    • DednDave
Re: sorting programming
« Reply #20 on: November 04, 2013, 10:13:11 AM »
ok - but the routine was intended to be more generic   :P
you probably knew that - lol

jj2007

  • Member
  • *****
  • Posts: 7633
  • Assembler is fun ;-)
    • MasmBasic
Re: sorting programming
« Reply #21 on: November 04, 2013, 11:03:09 AM »
you probably knew that - lol

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

dedndave

  • Member
  • *****
  • Posts: 8741
  • Still using Abacus 2.0
    • DednDave
Re: sorting programming
« Reply #22 on: November 04, 2013, 11:06:35 AM »
you're kidding, right ?
i used arrays larger than 64 kb sometimes