table 1. software hierarchy levels.. essential tools an assembler is a program that converts...

12
Table 1. Software Hierarchy Levels. L evel D escription A pplication Program Softw are designed for a particular class of applications. H igh-LevelLanguage (H LL) Program s are com piled into either assem bly language or m achine language.Each statem entusually translates into m ultiple m achine language instructions. Exam ples are C++,Pascal,Java,and VisualBasic. O perating System Contains procedures thatcan be called from program s w ritten in either high-levellanguage or assem bly language.This system m ay also contain an application program m ing interface (A PI). A ssem bly Language (A SM ) U ses instruction m nem onics thathave a one-to-one correspondence w ith m achine language. M achine Language (M L) N um eric instructions and operands thatcan be stored in m em ory and directly executed by the com puter processor.

Post on 21-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file)

Table 1. Software Hierarchy Levels.

Level Description

Application ProgramSoftware designed for a particular class ofapplications.

High-Level Language (HLL)

Programs are compiled into either assembly languageor machine language. Each statement usuallytranslates into multiple machine language instructions.Examples are C++, Pascal, Java, and Visual Basic.

Operating System

Contains procedures that can be called from programswritten in either high-level language or assemblylanguage. This system may also contain an applicationprogramming interface (API).

Assembly Language (ASM)Uses instruction mnemonics that have a one-to-onecorrespondence with machine language.

Machine Language (ML)Numeric instructions and operands that can be storedin memory and directly executed by the computerprocessor.

Page 2: Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file)

Essential Tools

• An assembler is a program that converts source-code

programs into a machine language (object file).

• A linker joins together two or more object files and

produces a single executable file.

• A debugger loads an executable program, displays

the source code, and lets the programmer step

through the program one instruction at a time, and

display and modify memory.

Page 3: Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file)

ASM ML

ML

ML

ML

ML

HLL

Figure 1. Machine Language Generation by ASM and HLL programs.

Page 4: Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file)

Table 2. Comparison of Assembly Language to HLLs.

Type of Application High-Level Language Assembly Language

Business applicationsoftware, written forsingle platform, mediumto large size.

Formal structures make iteasy to organize andmaintain large sections ofcode.

No formal structure.Programmer must impose anartificial structure.

Hardware device driver. Language may not providefor direct hardware access.Awkward coding techniquesmust be used, resulting inpossible maintenanceproblems.

Hardware access isstraightforward and simple.Easy to maintain when theprograms are short and welldocumented.

Business applicationwritten for multipleplatforms (differentoperating systems).

Usually very portable. Thesource code can berecompiled on each targetoperating system withminimal changes.

Must be recoded separatelyfor each platform, oftenusing an assembler with adifferent syntax. Difficult tomaintain.

Embedded systems andcomputer gamesrequiring directhardware access.

Produces too muchexecutable code, and maynot run efficiently.

Ideal, because theexecutable code is smalland runs quickly.

Page 5: Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file)

Figure 2. Assembly Language Subroutines Used as Hardware Interfaces.

ApplicationProgram

InterfaceSubroutine

OperatingSystem

Device DriverSubroutine

Hardware

Page 6: Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file)

Machine Language

• Consists of binary numbers• The "native" language of the computer• Each ML instruction contains an op code (operation

code) and zero or more operands. • Examples:

OpcodeOperand Meaning-------------------------------------------------40 increment the AX register05 0005 add 0005 to AX

Page 7: Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file)

Page 7: Bits, Bytes, and Doublewords:

byte byte

wordbit01 000 10 1 10 1 010 10

Each 1 or 0 is called a bit.

Page 8: Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file)

Storage Type Bits Range (low - high)

Unsigned byte 8 0 to 255

Unsigned word 16 0 to 65,535

Unsigned doubleword 32 0 to 4,294,967,295

Unsigned quadword 64 0 to 18,446,744,073,709,551,615

Table 3. Storage Sizes and Ranges of Unsigned Integers.

Page 9: Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file)

System Base Possible Digits

Binary 2 0 1

Octal 8 0 1 2 3 4 5 6 7

Decimal 10 0 1 2 3 4 5 6 7 8 9

Hexadecimal 16 0 1 2 3 4 5 6 7 8 9 A B C D E F

Table 4. Digits in Various Number Systems.

Page 10: Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file)

Format Value

ASCII binary "01000001"

ASCII decimal "65"

ASCII hexadecimal "41"

ASCII octal "101"

Page 9. ASCII Digit String.

Page 11: Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file)

2n Decimal Value 2n Decimal Value

20 1 28 256

21 2 29 512

22 4 210 1024

23 8 211 2048

24 16 212 4096

25 32 213 8192

26 64 214 16384

27 128 215 32768

Table 5. Binary Bit Position Values.

Page 12: Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file)

Figure 3. Converting Binary to Decimal.

9

8+ 1