Software: Application Software Usually Used by End-User
Software: Application Software Usually Used by End-User
Software: Application Software Usually Used by End-User
Software
Application software usually used by end-user It is concerned with the solution of some problem, using the computer as a tool, instead of how computers actually work. System software System software consists of a variety of programs that support the operation of a computer (ex: text editor, compiler, debugger) One characteristic in which most system software differ from application software is machine dependency A system software programmer must know the target machine structure
System Software
The system software includes Assembler Linker Loader Macro processor Text editor Compiler Operating system Debugging system Source Code Control System (optional) Database Management System
ASSEMBLER
Role of Assembler
Role of Assembler
Source Program
Assembler
Object Code
Linker
Executable Code
Loader
Introduction to Assemblers
Fundamental functions translating mnemonic operation codes to their machine language equivalents assigning machine addresses to symbolic labels Machine dependency different machine instruction formats and codes
Assembler Directives
Pseudo-Instructions Not translated into machine instructions Providing information to the assembler Basic assembler directives START
Assemblers functions
Convert mnemonic operation codes to their machine language equivalents Convert symbolic operands to their equivalent machine addresses Build the machine instructions in the proper format Convert the data constants to internal machine representations Write the object program and the assembly listing
Source program
Pass 1
Pass 2
Object codes
OPTAB
SYMTAB
Data Structures Operation Code Table (OPTAB) Symbol Table (SYMTAB) Location Counter (LOCCTR) OPTAB (operation code table) Content menmonic, machine code (instruction format, length) etc. Characteristic Static table Implementation array or hash table, easy for search. LOCCTR (Location Counter)
SYMTAB None of the relative terms may enter into a multiplication or division operation Errors: BUFEND+BUFFER 100-BUFFER 3*BUFFER The type of an expression Keep track of the types of all symbols defined in the program
Type R R R A
MACRO
Introduction Concept A macro instruction is a notational convenience for the programmer It allows the programmer to write shorthand version of a program (module programming) The macro processor replaces each macro invocation with the corresponding sequence of statements (expanding)
Macro Processor
Recognize macro definitions Save the macro definition Recognize macro calls Expand macro calls
Macro Processor
Expanded Code
Compiler or Assembler
Obj Code
obj
Source STRG MACRO STA DATA1 STB DATA2 STX DATA3 MEND . STRG . STRG . .
Expanded source . . . STA DATA1 STB DATA2 STX DATA3 . STA DATA1 STB DATA2 STX DATA3 .
LOADERS
Introduction
To execute an object program, we needs Relocation, which modifies the object program so that it can be loaded at an address different from the location originally specified Linking, which combines two or more separate object programs and supplies the information needed to allow references between them Loading and Allocation, which allocates memory location and brings the object program into memory for execution
Type of loaders
Assemble-and-go loader Absolute loader (bootstrap loader) Relocating loader (relative loader) Direct linking loader
Design options
Linkage editors Dynamic linking Bootstrap loaders
Assemble-and-go Loader
Characteristic The object code is stored in memory after assembly Single JUMP instruction Advantage Simple, developing environment Disadvantage Whenever the assembly program is to be executed, it has to be assembled again Programs have to be coded in the same language
Begin read Header record verify program name and length read first Text record while record type is not E do begin {if object code is in character form, convert into internal representation} move object code to specified location in memory read next object program record end jump to address specified in End record end
Relocating Loaders
Motivation efficient sharing of the machine with larger memory and when several independent programs are to be run together support the use of subroutine libraries efficiently Two methods for specifying relocation Modification record (Fig. 3.4, 3.5) Relocation bit (Fig. 3.6, 3.7)
Each instruction is associated with one relocation bit These relocation bits in a Text record is gathered into bit masks
Modification Record
For complex machines Also called RLD specification Relocation and Linkage Directory
Modification record col 1: M col 2-7: relocation address col 8-9: length (halfbyte) col 10: flag (+/-) col 11-17: segment name
Program Linking
Goal Resolve the problems with EXTREF and EXTDEF from different control sections Linking 1. User, 2. Assembler, 3. Linking loader Example Program in Fig. 3.8 and object code in Fig. 3.9 Use modification records for both relocation and linking Address constant External reference
EDITORS
A text editor is a program that enables you to create and edit text files. The distinction between editors and word processors is not clear-cut, but in general, word processors provide many more formatting features. Interactive program debugging system provides programmers with facilities that aid in the testing and debugging of programs. Although the desirability of such systems has been recognized for some time, there are relatively few actual debugging systems in practical use. The interactive text editor has become an important aspect of almost any computing environment. No longer are editors thought af as tools for programmers. It is now increasingly recognised that text editor should be considered the primary interface to the computer for all types of "knowledge workers" as they compose, organise, study and manipulate computer-based information. An interactive editor is a computer program that allows a user to create and revise a target document. The term document includes objects such as computer programs, text, equation, tables linker, loader and Operating System, diagrams, line art and photographs; anything that one might find on a printed page: A text editor is a program in which the primary elements being edited are character strings of the target text. We also presented a detailed descriptive of Unix operating system. In this unit, we take up issues related to a Text Editor and a Debugging system.
There are many types of editors, but they fall into two general categories: Line editors: A primitive form of editor that requires you to specify a specific line of text before you can make changes to it. Screen oriented editors: Also called full screen editors, these editors enable you to modify an text that appears on the display screen by moving the cursor to the desired location. The user of an interactive editor is presented with a conceptual model of the editing system. This model is an abstract framework on which the editor and the world on which it operates are based. The conceptual model, in essence provides an easily understood abstractions of the target document and its elements, with a set of guidelines describing the effects of operations on these elements. Besides the conceptual mode, the user interface is concerned with the input devices, the output devices and the interaction language of the system.