{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

04 - Click to edit Master subtitle style Chapter Four...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Click to edit Master subtitle style Chapter Four Modern Programming Languages, 2nd ed. Language Systems Chapter Four Modern Programming Languages, 2nd ed. 11 Chapter Four Modern Programming Languages, 2nd ed. Outline ■ The classical sequence ■ Variations on the classical sequence ■ Binding times ■ Debuggers ■ Runtime support Chapter Four Modern Programming Languages, 2nd ed. 22 Chapter Four Modern Programming Languages, 2nd ed. The Classical Sequence ■ Integrated development environments are wonderful, but… ■ Old-fashioned, un-integrated systems make the steps involved in running a program more clear ■ We will look the classical sequence of steps involved in running a program ■ (The example is generic: details vary from machine to machine) Chapter Four Modern Programming Languages, 2nd ed. 33 Chapter Four Modern Programming Languages, 2nd ed. Creating ■ The programmer uses an editor to create a text file containing the program ■ A high-level language: machine independent ■ This C-like example program calls fred 100 times, passing each i from 1 to 100: Chapter Four Modern Programming Languages, 2nd ed. 44 int i; void main() { for (i=1; i<=100; i++) fred(i); } Chapter Four Modern Programming Languages, 2nd ed. Compiling ■ Compiler translates to assembly language ■ Machine-specific ■ Each line represents either a piece of data, or a single machine-level instruction ■ Programs used to be written directly in assembly language, before Fortran (1957) ■ Now used directly only when the compiler does not do what you want, which is rare Chapter Four Modern Programming Languages, 2nd ed. 55 Chapter Four Modern Programming Languages, 2nd ed. Chapter Four Modern Programming Languages, 2nd ed. 66 int i; void main() { for (i=1; i<=100; i++) fred(i); } i: data word 0 main: move 1 to i t1: compare i with 100 jump to t2 if greater push i call fred add 1 to i go to t1 t2: return compiler Chapter Four Modern Programming Languages, 2nd ed. Assembling ■ Assembly language is still not directly executable – Still text format, readable by people – Still has names, not memory addresses ■ Assembler converts each assembly- language instruction into the machine’s binary format: its machine language ■ Resulting object file not readable by people Chapter Four Modern Programming Languages, 2nd ed. 77 Chapter Four Modern Programming Languages, 2nd ed. Chapter Four Modern Programming Languages, 2nd ed. 88 i: data word 0 main: move 1 to i t1: compare i with 100 jump to t2 if greater push i call fred add 1 to i go to t1 t2: return assembler xxxx i xx i x xxxxxx x xxx i x fred xxxx i xxxxxx xxxxxx i: main: Chapter Four Modern Programming Languages, 2nd ed....
View Full Document

{[ snackBarMessage ]}

Page1 / 51

04 - Click to edit Master subtitle style Chapter Four...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online