CS 342 Lecture -*- Outline -*- * Motivation for programming languages: automation ** tedium of machine language programming Computer machine languages are extremely simple and low-level. -makes programming tedious -not designed to be read or written by humans e.g. 1107: 46 1112 1061 ** programming in the late 1940s In the early days (late 1940s) it was even worse: -small memories (1K), so needed compact code -slow, so great emphasis on run-time efficiency -irregular instruction sets, so hard to remember e.g., 4 address code (next instr to execute). -mathematical problems required manual scaling of numbers -floating point and indexing not provided by hardware ** Design notations to aid coding: *** Flow charts. *** Assemblers one machine instruction generated by each assemby instruction uses letters instead of numbers. e.g., Loop: add 11,12 *** Pseudo-codes higher than machine level, new abstract machine! abstraction is that of a more regular, useful computer => a virtual machine Same as any programming language. ** Pseudo-code evolution Small routines developed to do floating point and indexing. How to use these routines: -call as subroutines (need calling conventions, etc.) -have whole program be a list of these routines and their data (interpretation) -insert code of routines (as a macro expansion: compiling) ** Interpretation program is a list of pseudo-codes, interpreter keeps track via instruction pointer DRAW PICTURE!