1. Trang chủ
  2. » Giáo án - Bài giảng

The architecture of computer hardware and systems software an information technology approach ch17

30 121 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 30
Dung lượng 810,5 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

The Program Translation Process Terms, terms, and more terms!. Source Object Executable Translator Linker Loader...  Translates high-level language into level instructions low- High-l

Trang 1

Chapter 17

Programming Tools

The Architecture of Computer Hardware

and Systems Software:

An Information Technology Approach

3rd Edition, Irv Englander John Wiley and Sons 2003

Trang 2

Programming Tools Overview

Integrated Development Environments (IDEs)

combine several of the above programming tools

Trang 3

The Program Translation Process

 Terms,

terms, and

more terms!

Source Object

Executable

Translator Linker

Loader

Trang 4

Visual Basic IDE

Trang 5

Program Text Editors

 Word processors format the appearance of the text

 Text editors

 Format the spacing between words for legibility

 Ideal for structured languages

 Text is the same font size

 Examples

 DOS – Edit

 Windows – Notepad, Wordpad

 Unix / Linux – ed, vi, emacs

 IDEs

 MS Visual C++, Symantec Visual Cafe

Trang 7

 Inherently machine specific

 Architectures may become obsolete

 Lack of programming structure

Trang 8

 Binary code = machine code

 Hex code

 Assembly Language

 Mnemonic names  op codes

 Labels  memory addresses

Trang 9

What Does This Program Do?

00 IN 901 ;input three numbers and save

01 STO 99 399

02 IN 901

03 STO 98 398

04 IN 901

05 STO 97 397 ;subtract number in 98 from that in 97

06 SUB 98 298 ;number in 97 larger

07 BRP 10 811 ;number in 98 larger, restore 98

08 LDA 98 598

09 BR 11 611

10 LDA 97 597 ;restore 97

11 STO 96 396 ;store larger of (97, 98) in 96

12 SUB 99 299 ;subtract number in 99 from larger

Trang 13

 Translates high-level language into level instructions

low- High-level language: Source code

 Machine-level: Object code

 Changes, including bug fixes, require

recompiling

Trang 14

Language Components

 Lexicon

 All legal words in the language

 Meaning and type

 Syntax

 grammar rules

 Semantics

 meaning of command

Trang 15

Computer Language Descriptions

Trang 16

Railroad Diagram Examples

Trang 17

Typical BNF Rules for Java

Trang 18

Parsed English Sentence

Trang 19

The Compilation Process

Trang 20

Process of Parsing

 Lexical analysis

 Also known as scanning

 Divides the string of input characters into single elements, tokens, based on strict computer punctuation

Trang 21

Source Code Instructions

 Function, procedure, or subroutine calls

 Receives control via a call instruction, receives and

possibly modifies parameters, and returns control to the instruction after the call

Trang 22

Recursive Descent Parsing

Trang 23

 Compiler analyzes code in order to

 Reduce amount of code

 Eliminate repeated operations

 Reorganize parts of of the program to execute faster and more efficiently

 Use computer resources more effectively

Trang 24

Object file or object

Linking

Trang 25

 Searches program libraries to find library

routines used by the program

 Library: collection of pre-written functions and

subroutines made available to perform commonly required activities

 Determines the memory locations that code from each module will occupy and relocates instructions by adjusting absolute references

 Resolves references among files

Trang 26

Why Link?

 Construct single executable program from

multiple object code files compiled at different times

 Program can be subdivided into components and parceled out to different developers

 Example

 Main program and multiple subroutines written and compiled by different programmers at different

times

Trang 28

 Translates source code instructions into

machine language and executes it one

statement at a time

 Disadvantages

 Longer to execute, particularly bad for loops

 Uses more memory

 Advantage

 Faster testing and code modification

 Examples of interpreted languages

 Java, BASIC, LISP

Trang 29

Interpreter vs Compiler

Resources during execution Interpreter Compiler

Contents in memory

Interpreter/compiler Yes No

Source code Partial No

Executable code Yes Yes

CPU cycles

Translation operations Yes No

Library linking Yes No

Application program Yes Yes

Trang 30

 Assembly language debuggers

 Source code debuggers

 Step through programs

 Check variable values

Ngày đăng: 10/01/2018, 16:24

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN