Results 1 to 2 of 2

Thread: ADDing ascii value

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    1

    ADDing ascii value

    Hi i need to order by ascii value

    s1STR: .asciiz "blar blar\n"
    s2STR: .asciiz "blar blar blar\n"
    s3STR: .asciiz "blar blar blar blar blar blar\n"

    stringsARRAY: .word s1STR, s2STR, s3STR, 0

    .text

    .globl main

    main

    Code ommited

    do_sort_strings:
    li $a0, 10 #parameter n
    sll $a0, $a0, 2
    outer:
    sub $t0, $a0,8
    li $t1, 0
    inner:
    lw $t2, stringsARRAY+4($t0)
    lw $t3, stringsARRAY($t0)
    bgt $t2, $t3, no_swap

    sw $t2, stringsARRAY($t0)
    sw $t3, stringsARRAY+4($t0)
    li $t1, 1
    no_swap:
    sub $t0, $t0, 4
    bgez $t0, inner

    bnez $t1, outer

    Print ommited

    This i what i have so far
    i does not add ascii values for strings
    and may not order correctly
    im new to assembly and need help and pointer
    thanks

  2. #2
    Addicted Member
    Join Date
    Aug 2005
    Location
    York
    Posts
    197

    Re: ADDing ascii value

    Most the assemblers on this forum are x86 assembly programmers...so I'm afraid we can't help you here - except redirect you to another forum.

    This is MIPS assembly i believe - which is significantly different to the assembly language we are familiar with.

    Sorry

    Cheers.

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