Results 1 to 3 of 3

Thread: Sorting an array of strings in asm

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Texas
    Posts
    313

    Sorting an array of strings in asm

    Does anyone know how to sort an array of strings in asm? I have an array of 10 strings the strings can range any where from 0 to 20 char long. For example the array may contain:
    one
    two
    three
    four
    five
    six
    seven
    eight
    nine
    ten

    and that needs to be sorted. Can someone please help thank you for your time.

  2. #2
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    If these are in an array in which the space reserved for each of the strings are of a constant length, then I would use a Temp variable of that length. At each swap, load in each character into temp and the second into its rightful spot. Next load temp into its swapped position. Continue through the array until completed.

    Note that I am using a bubble sort because it will take a few lines of code already.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Texas
    Posts
    313
    yeah this was for my project in school, that class is over w/ thank god. But thank you for your help and i did use a bubble sort. (had the c++ code and just converted it)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width