A little (lot) assembly language help?

NuclearFusi0n

Diamond Member
Jul 2, 2001
7,028
0
0
This program will have two components:

1. An input routine allowing the user to input a specified number of letters (say 10), which will be stored in an array, i.e. in a sequence of contiguous memory locations.
2. A routine that will sort the stored letters into ascending order (i.e. A to Z), re-store them into the same array, and output them to the monitor.


I sux at this, and have NO clue what to do mainly because i've missed a few classes here and there (damn you 8am class) This is for some LC2 simulator...
If anybody feels like helping me out i will give you a great big nonsexual <3 unless you are a cute woman keke.
 

xyion

Senior member
Jan 20, 2001
706
0
0
well, for the first part why dont you use a loop and index addressing mode? something like this: (i use motorola HC11 MIPS, so the syntax could differ)
LDAA #00
LDX #$base_address_for_storage
loop CMPA #9
BEQ done
LDAB input_number
ST@B 0,X ; hey it stands for STore Accumulator B! I'm sorry!
INCX
INCA
BRA loop

basically, it uses A as a counter, X as the storage location of the 10 digits, and B to take input and store it in the array location. Not terribly difficult. Make sure you define 10 continuious bytes somewhere. As I said, this is for Motorolas HC11E9, so your code will probably differ, but you get an idea.

For the second part, well, I dont really feel like figuring out an algorithm. Off the top of my head, convert to ASCII and compare numbers.

good luck
 

XZeroII

Lifer
Jun 30, 2001
12,572
0
0
Assembly is different for different chips. I know assembly for the x86 (knew it) but don't remember enough to help. What you are asking is a huge job in assembly and I doubt anyone will take the time to actually type the whole thing out. Good luck