• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

A little (lot) assembly language help?

NuclearFusi0n

Diamond Member
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.
 
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
 
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
 
Back
Top