MIPS Assembly
Oct. 18th, 2009 01:41 pmExercise:
Write a program for the SPIM simulator that uses `syscall' instruction to prompt the user to enter strings one per line representing valid decimal integers in the range from 0 to 999999999999. Use 64 bits for each integer. Valid strings may only contain the characters '0' through '9'. All strings other than valid decimal integers should be ignored. The numeric value indicated by each of the decimal strings should be added into a running 64-bit sum until a total of 10 strings have been entered or until the user indicates that there is no more input. The computed 64-bit sum should then be displayed on the console. This exercise involves converting between external and internal representation for input and between internal and external representation for output.
( Solution )