Oct. 18th, 2009

Exercise:

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 )

Profile

Anton Salikhmetov

November 2018

S M T W T F S
    123
45678 910
11121314151617
18192021222324
252627282930 

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 4th, 2025 09:42 am
Powered by Dreamwidth Studios