Академический Документы
Профессиональный Документы
Культура Документы
Chapter 1
Introduction
1
Introdution
Application Software
» A set of programs written in a specific any programming
language to solve a particular problem.
» It is independent of the machine on which it is operated.
» Concerned mainly with the solution of the problem and
makes use of the computer software as a tool.
» Purpose of supporting or improving the user’s work with a
software.
» The focus is on the application.
3
Types…
Example
» Word processing
– MS word, WordPad
» Database
– Oracle, MS Access
» Spreadsheet
– Excel, Apple Numbers
» Multimedia
– Real Player, Media Player
» Presentation Graphics
– MS PowerPoint
4
Types…
System Software
» A set of programs that creates the environment to facilitate
working of an application software.
» Consists of a variety of programs that support the operation
of a computer.
» One characteristic in which most system software differ from
application software is machine dependency.
» Acts as an intermediary between computer hardware and
application programs.
» Controls the computer system and enhances its
performance.
» Focus is on the system.
5
Types…
Example:
» In programming courses
– text editor, compiler, loader or linker, debugger, macro
processor
» In assembly language
– assembler
» All of these processes are controlled by interacting
with the operation system.
6
Examples of System Software
Text Editor
» Allows user to create/modify a file having only
plain text.
» Edit contents to get an immediate visual feedback
– Emacs (Unix)
– Notepad (Microsoft)
– SimpleText, TextEdit (Mac OS)
7
Examples…
Compiler
» Translates high level language to machine
language.
» Source code into data, that computer can
understand.
» Source code to object code
– ADA, BASIC, Fortran, Pascal
– C, C++, C#
– Open Source
8
Examples…
Linker
» Object code from compiler is turned into executable program
» Gathers 1 or more objects generated by the compiler &
combines into a single EXE
» In IBM OS/360 termed as linkage editor
Loader
» Loads programs from executables into memory and executes 9
Examples…
Debugger
» Tests & debugs errors
» Code run on Instruction Set Simulator (ISS)
– Step by step
– Breakpoint
DEBUG – Microsoft DOS built-in debugger
Nemiver – Graphical C/C++ debugger
Ups – Fortran, C
VB Watch – Visual Basic
Jswat – Open source Java
Xdebug – PHP
10
Examples…
Assembler
» Assembly language to machine language
» Mnemonics to machine code
» Produces executable machine code
» Pattern of bits
Interpreter
» High level language to machine language
» Executes immediately
11
Need for System Software
12
System Software and Machine
Architecture
15
SIC Machine Architecture
Memory
» Consists 8-bit bytes
» Any 3 consecutive bytes form a word (24 bits)
– All addresses in SIC are byte address.
– Words are addressed by the location of their lowest
numbered byte.
» Total of 215 (32,768) bytes in the computer
memory
Least significant part of a numeric value is stored at the
lowest numbered address
16
SIC…
Registers
» Five registers, each have 24 bit in length
Register Number Function Use
A 0 Accumulator Arithmetic operations
X 1 Index register Addressing
L 2 Linkage Storing return address for subroutine
register jump instruction (JSUB)
PC 8 Program Contains Address of next instruction to
counter be fetched for execution
SW 9 Status word Flags, other information including
Condition Code (CC)
Note: the numbering scheme is chosen for compatibility with XE version of SIC
17
SIC…
Data Formats
» Integers are stored as 24-bit binary numbers
» 2’s complement for negative values
» 8-bit ASCII for characters
» No floating point hardware in standard SIC
Instruction Formats
» 24-bit format
» The flag bit x indicates indexed-addressing mode
8 1 15
opcode X address
18
SIC…
Addressing modes
» 2 addressing modes available
– Indicated by setting of x bit in the instruction
– The table describes how the target address is calculated
from the address given in the instruction
Instruction Set
SIC provides basic instruction for simple tasks
» load and store registers: LDA, LDX, STA, STX, etc.
» integer arithmetic operations: ADD, SUB, MUL, DIV, etc.
– All arithmetic operations involve register A and a word in
memory, with the result being left in the register
» comparison: COMP
– COMP compares the value in register A with a word in memory,
this instruction sets a condition code CC to indicate the result
» conditional jump instructions: JLT, JEQ, JGT
– these instructions test the setting of CC and jump accordingly
» subroutine linkage: JSUB, RSUB
– JSUB jumps to the subroutine, placing the return address in register L
– RSUB returns by jumping to the address contained in register L 20
SIC…
21
SIC/XE Machine Architecture
Memory
» Larger Memory
– 220 bytes (1 megabyte) in the computer memory
– Leads to change in instruction formats & addressing modes
Registers
» Additional registers provided
22
SIC/XE Machine…
Data Formats
» Similar data format as the standard SIC.
» In addition, there is 48 bit Floating-point data type
represented with the following format.
s Exponent fraction
1 11 36
» The absolut value of number represented is,
– frac*2(exp-1024)
fraction: 0~1
exponent: 0~2047
Sign is indicated by ‘s’ (0 = +ve, 1 = -ve)
23
SIC/XE Machine…
Instruction formats
» The larger memory on SIC/XE mean an address will no longer
fit into 15 bit field.
» Two possible options:
– Use some from of relative addressing
– Or extended the address field to 20 bit
– Both options are included in SIC/XE(format 3 and format 4)
» SIC also provides some instructions that do not reference at all
– Format one
– Format two
24
SIC/XE Machine…
Formats 1 and 2
n: indirect
Instruction Formats do not
reference i: immediate
8 memory at all x: index
Format 1 (1 byte) opcode b: base
8 4 4 p: pc
Format 2 (2 bytes) opcode r1 r2 e: extended
6 111111 12
Format 3 (3 bytes)
opcode n i x b p e disp
e=0
6 111111 20
Format 4 (4 bytes)
opcode n i x b p e Address
e=1
Bit e distinguishes between formats 3 and 4
Large memory extends addressing capacity 25
SIC/XE Machine…
Addressing modes
Base relative/b (n=1, i=1, b=1, p=0)
Program-counter relative/p (n=1, i=1, b=0, p=1)
Direct/ (n=1, i=1, b=0, p=0)
Immediate (n=0, i=1, x=0)
Indirect (n=1, i=0, x=0)
Indexing (both n & i = 0 or 1, x=1)
Extended (e=1)
Note: Indexing cannot be used with immediate or indirect
addressing
26
SIC/XE Machine…
n i x b p e
opcode 1 1 1 0 0 disp
n i x b p e
opcode 1 1 disp
30
SIC/XE Machine…
32
PC-relative simple addressing: (PC) + disp
Base-relative indexed simple addressing: (B) + disp + (X)
PC-relative indirect addressing: (PC) + disp
Immediate addressing: disp
SIC simple addressing: b/p/e + disp
Simple addressing: addr
Instruction Set
» new registers: LDB, STB, etc.
» floating-point arithmetic: ADDF, SUBF, MULF, DIVF
» register move: RMO
» register-register arithmetic: ADDR, SUBR, MULR, DIVR
» supervisor call: SVC
– generates an interrupt for OS
Input/Output
» SIO, TIO, HIO: start, test, halt the operation of I/O device
34
SIC and SIC/XE
Programming Examples
35
Programming Examples
WORD – Integer constant BYTE – Character constant
Immediate addressing
makes the program
run faster because it
need not fetch five
from the memory.
• During 1st loop exec, T.A. for LDCH will be address of 1st byte of STR1
• ll’ly STCH stores copied character into 1st byte of STR2
• TIX 2 operations
• adds 1 to value in register X
• compares new value in register X to value of operand
Fig: Looping and indexing SIC Loop copies 11 bit character string to another 39
Programming Examples
• Same as TIX. Value for comparison is taken form another register, not
from memory
• Loop efficient, b’coz value not fetched from memory each time the
loop is executed
• adds 1 to
value in
register X
• compares
new value in
register X to
value of
operand
44
Fig: Subroutine call & record input operations SIC 44
Programming Examples
• Immediate addressing
• TIXR instruction
46