table 1. software hierarchy levels.. essential tools an assembler is a program that converts...
Post on 21-Dec-2015
212 views
TRANSCRIPT
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.
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.
ASM ML
ML
ML
ML
ML
HLL
Figure 1. Machine Language Generation by ASM and HLL programs.
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.
Figure 2. Assembly Language Subroutines Used as Hardware Interfaces.
ApplicationProgram
InterfaceSubroutine
OperatingSystem
Device DriverSubroutine
Hardware
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: Bits, Bytes, and Doublewords:
byte byte
wordbit01 000 10 1 10 1 010 10
Each 1 or 0 is called a bit.
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.
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.
Format Value
ASCII binary "01000001"
ASCII decimal "65"
ASCII hexadecimal "41"
ASCII octal "101"
Page 9. ASCII Digit String.
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.
Figure 3. Converting Binary to Decimal.
9
8+ 1