
Programming
•it's hard to do the programming to get something done
•details are hard to get right, very complicated, finicky
•not enough skilled people to do what is needed
•therefore, enlist machines to do some of the work
– leads to programming languages
•it's hard to manage the resources of the computer
•hard to control sequences of operations
•in ancient times, high cost of having machine be idle
•therefore, enlist machines to do some of the work
– leads to operating systems
Evolution of programming languages
•1940's: machine level
– use binary or equivalent notations for actual numeric values
•1950's: "assembly language"
– names for instructions: ADD instead of 0110101, etc.
– names for locations: assembler keeps track of where things are in memory;
translates this more humane language into machine language
– this is the level used in the "toy" machine
– needs total rewrite if moved to a different kind of CPU
loop get # read a number
ifzero done # no more input if number is zero
add sum # add in accumulated sum
store sum # store new value back in sum
goto loop # read another number
done load sum # print sum
print
stop
sum 0 # sum will be 0 when program starts instructions
assembler
assembly lang
program