INTERNAL TEST (SCHEME AND SOLUTION)

Size: px
Start display at page:

Download "INTERNAL TEST (SCHEME AND SOLUTION)"

Transcription

1 PES Institute of Technology, Bangalore South Campus (Formerly PES School of Engineering) (Hosur Road, 1KM before Electronic City, Bangalore ) Dept of MCA INTERNAL TEST (SCHEME AND SOLUTION) 1 Subject Name: System Programming Subject Code: (13MCA24) 1. a) Define system Software and it s components System software is a set of programs that manage the resources of a computer system. System Software is a collection of system programs that perform a variety of functions. Application software performs specific tasks for the computer user. Application software is a program which program written for, or, by, a user to perform a particular job Components of System software: Assembler Loader Compiler Interpreter Operating System b) Discuss the difference between system and Application software Subject Application Software System Software Definition Application software is computer software designed to help the user to perform specific tasks. System software is computer software designed to operate the computer hardware and to provide a platform for running application software. Purpose It is specific purpose software. It is general-purpose software. Classification Package Program, Time Sharing,

2 Resource Sharing, Client Server Batch Processing Operating System Customized Program Real time Operating System Multi-processing Operating System Multi-programming Operating System Environment Execution Time Essentiality Number Application Software performs in a environment which created by System/Operating System It executes as and when required. Distributed Operating System System Software Create his own environment to run itself and run other application. It executes all the time in computer. Application is not essential for a System software is essential for a computer computer. The number of application software The number of system software is less than is much more than system software. application software. 2. Explain the architecture of SIC/XE and mention few difference from SIC Memory: 1 word = 24 bits (3 8-bit bytes) total (SIC) = 2 15 (32,768) bytes (32Kbytes) total (SIC/XE) = 2 20 (1,048,576) bytes (1Mbyte) Registers: 10 x 24 bit registers MNEMONIC Register # Comment/note A 0 Accumulator X 1 Index register L 2 Linkage register (JSUB/RSUB) B (SIC/XE) 3 Base register

3 S (SIC/XE) 4 General register T (SIC/XE) 5 General register F (SIC/XE) 6 Floating Point Accumulator (48 bits) PC 8 Program Counter (PC) SW 9 Status Word (includes Condition Code, CC) Data Format: Integers - stored in 24 bit, 2's complement format Characters stored in 8-bits, in ASCII format Float (SIC/XE) stored in 48 bit signed-exponent-fraction format: s exponent {11} fraction {36} fraction range: 0..1 exponent: unsigned binary range s: 0=positive, 1=negative therefore, the absolute floating point number value is: f*2 (e-1024) Instruction Format: SIC: op {8} x address {15} x indicates indexed-addressing mode SIC/XE: Format 1 (1 byte):

4 op {8} Format 2 (2 bytes): op {8} r1 {4} r2 {4} Format 3 (3 bytes): op {8} n i x b p e displacement {12} Format 4 (4 bytes): op {8} n i x b p e address {20} Formats 3 & 4 introduce addressing mode flag bits: (note I will use TA for "target address" & disp for "displacement") flags n & i: n=0 & i=1 immediate addressing - TA is used as an operand value (no memory reference) n=1 & i=0 indirect addressing - word at TA (in memory) is fetched & used as an address to fetch the operand from n=0 & i=0 simple addressing TA is the location of the operand n=1 & i=1 simple addressing same as n=0 & i=0 flag x: x=1 indexed addressing add contents of X register to TA calculation flag b & p (Format 3 only): b=0 & p=0 direct addressing displacement/address field contains TA (note Format 4 always uses direct addressing) b=0 & p=1 PC relative addressing - TA=(PC)+disp (-2048<=disp<=2047)* b=1 & p=0 Base relative addressing - TA=(B)+disp (0<=disp<=4095)** * note - in PC relative, disp is interpreted as a 12 bit signed integer in 2's complement

5 ** note - in Base relative, disp is interpreted as a 12 bit unsigned integer flag e: e=0 use Format 3 e=1 use Format 4 Addressing Mode Table Instructions: SIC provides 26 instructions, SIC/XE provides an additional 33 instructions (59 total) SIC has 6 categories of instructions: load/store registers (LDA, LDX, LDCH, STA, STX, STCH, etc.) integer arithmetic operations (ADD, SUB, MUL, DIV) these will use register A and a word in memory, results are placed into register A compare (COMP) compares contents of register A with a word in memory and sets CC (Condition Code) to <, >, or = conditional jumps (JLT, JEQ, JGT) - jumps according to setting of CC subroutine linkage (JSUB, RSUB) - jumps into/returns from subroutine using register L input & output control (RD, WD, TD) - see next section SIC/XE has additional instructions available in each of the above mentioned categories, plus, it has 3 additional categories of instructions: floating point arithmetic operations (ADDF, SUBF, MULF, DIVF) register manipulation, operands-from-registers, and register-to-register arithmetics (RMO, RSUB, COMPR, SHIFTR, SHIFTL, ADDR, SUBR, MULR, DIVR, etc) Input and Output (I/O): 2 8 (256) I/O devices may be attached, each has its own unique 8-bit address 1 byte of data will be transferred to/from the rightmost 8 bits of register A

6 3 I/O instructions are provided: RD Read Data from I/O device into A WD Write data to I/O device from A TD Test Device determines if addressed I/O device is ready to send/receive a byte of data. The CC (Condition Code) gets set with results from this test: < device is ready to send/receive = device isn't ready SIC/XE Has capability for programmed I/O (I/O device may input/output data while CPU does other work) - 3 additional instructions are provided: SIO Start I/O HIO Halt I/O TIO Test I/O Write SIX and SIC/XE program for the following instruction (ALPHA+INCR-1) stores in BETA (GAMMA+INCR-1) in DELTA (ALPHA+INCR-1) Stores in BETA and the value (GAMMA+INCR-1) in DELTA... LDA ALPHA ADD INCR SUB ONE STA BETA LDA GAMMA ADD INCR SUB ONE STA DELTA ONE WORD 1 one-word constant ALPHA RESW 1 one-word variables BETA RESW 1

7 GAMMA RESW 1 DELTA RESW INCR RESW 4. Write an Algorithm for pass-1 of assembler Begin, Read first input line If OPCODE = START Then Begin save # [OPERAND] as starting address Initialize LOCCTR as starting address read next input line end {if START} Else initialize LOCCTR to 0 While OPCODE =/ END do Begin IF there is not a comment line then begin IF there is a symbol in the LABEL field then begin search SYMTAB for LABEL if found then

8 begin if symbol value as null set symbol value as LOCCTR and search the linked list with the corresponding operand PTR addresses and generate operand addresses as corresponding operand set symbol value as LOCCTR in symbol table and delete the linked list End Else insert (LABEL, LOCCTR) into SYMTAB end search OPTAB for OPCODE if found then begin search SYMTAB for OPERAND address if found then if symbol value not equal to null then store symbol value as OPERAND address else insert (symbol name, null ) add 3 to LOCCTR end

9 else if OPCODE = WORD then add 3 to LOCCTR else if OPCODE = RESW then Add 3 # [OPERAND] to LOCCTR Else if OPCODE = RESB then Add # [operand] to LOCCTR Else if OPCODE = BYTE then begin find the length of constant in bytes and length to LOCCTR convert constant to object code end If object code will not fit in to current text record then Begin write text record to object program initialize new text record End add object code to text record End write listing line read next input line

10 end Write last text record to object program Write End record to object program Write last listing line END { Pass 1} 5. Explain the following assembler directives START: specify name & starting address END: end of source program, specify the first execution instruction BYTE and BYTE: instructs the Assembler to ganarate constant as part of assembly code RESB and RESW: instruct the Assember to reserve the specifed amount of space for execution 6. write a note on machine independent assembler features Program Blocks Programs assembled was treated as a unit. The source programs logically contained subroutines, data areas, etc. However, they were handled by the assembler as one entity, resulting in a single block of object code. Some machines generate instructions and data to appear in the object program in a different order from source statements. Other machines results in creation of several independent parts of the object program.

11 These parts maintain their identity and are handled separately by the loader. Although the source program logically contains subroutines, data area, etc, they were assembled into a single block of object code in which the machine instructions and data appeared in the same order as they were in the source program. To provide flexibility: Program blocks Segments of code that are rearranged within a single object program unit Control sections Why Program Blocks? Segments of code that are translated into independent object program units To satisfy the contradictive goals: Separate the program into blocks in a particular order Large buffer area is moved to the end of the object program Using the extended format instructions or base relative mode may be reduced. (lines 15, 35, and 65) Placement of literal pool is easier: simply put them before the large data area, CDATA block. (line 253) Data areas are scattered

12 Program readability is better if data areas are placed in the source program close to the statements that reference them Literals

13 Let programmers to be able to write the value of a constant operand as a part of the instruction that uses it. This avoids having to define the constant elsewhere in the program and make up a label for it. Such an operand is called LITERAL. Value is stated literally in the instruction. A literal is identified with a prefix =. Literal is equivalent to: Define a constant explicitly and assign an address label for it Use the label as the instruction operand Why use literals: To avoid defining the constant somewhere and making up a label for it Instead, to write the value of a constant operand as a part of the instruction How to use literals: A literal is identified with the prefix =, followed by a specification of the literal value Example e.g A ENDFIL LDA =C EOF Specifies a 3-byte operand whose value is the character string EOF. 93 LTORG 002D * =C EOF 454F46 e.g WLOOP TD =X 05 E32011 Specifies a 1-byte literal with the hexadecimal value 05.

14 Literal - Implementation Assembler handles literal operands using literal table-littab Pass 1 Pass 2 Program Relocation literal name, the operand value and length, the address assigned to the operand build LITTAB with literal name, operand value and length, leaving the address unassigned when LTORG statement is encountered, assign an address to each literal not yet assigned an address search LITTAB for each literal operand encountered generate data values using BYTE or WORD statements generate modification record for literals that represent an address in the program It is often desirable to have more than one program at a time sharing the memory and other resources of the machine. Most of the time it is not practical to plan program execution this closely. We do not know exactly when jobs will be submitted, exactly how long they will run. In such situation the actual starting address of the program is not known until load time. 3. Explain and Generate an object code for below program

15 0000 COPY START FIRST STL RETADR 17202D 0003 LDB #LENGTH 69202D BASE 0006 CLOOP +JSUB RDREC 4B A LDA LENGTH D COMP # JEQ ENDFIL JSUB WREC 4B10105D 0017 J CLOOP 3F2FEC 001A ENDFIL LDA EOF D STA BUFFER 0F LDA # STA LENGTH 0F200D JSUB WREC 4B10105D 002A 3E D EOF BYTE C EOF 454F RETADR RESW LENGTH RESW BUFFER RESB RDREC CLEAR X B D WREC CLEAR X B OPCODES STL = 14, LDB=68, JSUB=48, LDA=00, STA=0C, J=3C, CLEAR=B4

Gechstudentszone.wordpress.com

Gechstudentszone.wordpress.com UNIT - 1 MACHINE ARCHITECTURE 11 Introduction: The Software is set of instructions or programs written to carry out certain task on digital computers It is classified into system software and application

More information

Chapter 1: Background

Chapter 1: Background Chapter 1: Background Hsung-Pin Chang Department of Computer Science National Chung Hsing University Outline 1.1 Introduction 1.2 System Software and Machine Architecture 1.3 The Simplified Instructional

More information

TRB-COMPUTER INSTRUCTOR COMPUTER SCIENCE UNIT IV. SYSTEM SOFTWARE 10% DISCOUNT FOR ALL PGTRB MATERIALS WITH QUESTION BANK.

TRB-COMPUTER INSTRUCTOR COMPUTER SCIENCE UNIT IV.  SYSTEM SOFTWARE 10% DISCOUNT FOR ALL PGTRB MATERIALS WITH QUESTION BANK. N COACHING CENTRE-TRICHY- TRB- COMPUTER INSTRUCTOR-COMPUTER SCIENCE STUDY MATERIAL-CONTACT: 822006 2017 N TRB-COMPUTER INSTRUCTOR COMPUTER SCIENCE UNIT IV SYSTEM SOFTWARE 10% DISCOUNT FOR ALL PGTRB MATERIALS

More information

Chapter 1 Background. Professor Gwan-Hwan Hwang Dept. Computer Science and Information Engineering National Taiwan Normal University

Chapter 1 Background. Professor Gwan-Hwan Hwang Dept. Computer Science and Information Engineering National Taiwan Normal University Chapter 1 Background Professor Gwan-Hwan Hwang Dept. Computer Science and Information Engineering National Taiwan Normal University 9/17/2009 1 Outlines 1.1 Introduction 1.2 System Software and Machine

More information

Chapter 2 Assemblers Machine-Dependent Assembler Features

Chapter 2 Assemblers Machine-Dependent Assembler Features Chapter 2 Assemblers -- 2.2 Machine-Dependent Assembler Features Outline Instruction format and addressing mode Program relocation Instruction format and addressing mode PC-relative or Base-relative addressing

More information

Introduction SIC, RISC & CISC 0. Introduction to Systems Programming This course aims at: Understanding what is going on behind the scenes The design and implementation of system software, such as Assemblers

More information

Chapter 1. Introduction

Chapter 1. Introduction Chapter 1 Introduction This Chapter gives you System Software & Machine Architecture The Simplified Instructional Computer SIC and SIC/XE Traditional (CISC) Machines - Complex Instruction Set Computers

More information

UNIT II ASSEMBLERS www.noyesengine.com www.technoscriptz.com 1 1. BASIC ASSEMBLER FUNCTIONS 2. A SIMPLE SIC ASSEMBLER 3. ASSEMBLER ALGORITHM AND DATA STRUCTURES 4. MACHINE DEPENDENT ASSEMBLER FEATURES

More information

DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY SIRUVACHUR, PERAMBALUR DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY SIRUVACHUR, PERAMBALUR DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY SIRUVACHUR, PERAMBALUR 621113. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS2304- SYSTEM SOFTWARE PART-B QUESTIONS 1. EXPLAIN THE ARCHITECTURE

More information

CS2422 Assembly Language & System Programming

CS2422 Assembly Language & System Programming CS2422 Assembly Language & System Programming December 7, 2006 Today s Topic Assembler: Machine Dependent Features SIC/XE Program Relocation Modification Records in an Object File. Study Guide Sections

More information

CS2422 Assembly Language & System Programming

CS2422 Assembly Language & System Programming CS2422 Assembly Language & System Programming November 30, 2006 Today s Topic Assembler: Basic Functions Section 2.1 of Beck s System Software book. Reading Assignment: pages 43-52. Role of Assembler Source

More information

Unit 2 -- Outline. Basic Assembler Functions Machine-dependent Assembler Features Machine-independent Assembler Features Assembler Design Options

Unit 2 -- Outline. Basic Assembler Functions Machine-dependent Assembler Features Machine-independent Assembler Features Assembler Design Options Unit 2 -- Outline Basic Assembler Functions Machine-dependent Assembler Features Machine-independent Assembler Features Assembler Design Options Introduction to Assemblers Fundamental functions translating

More information

Assemblers. System Software by Leland L. Beck. Chapter 2

Assemblers. System Software by Leland L. Beck. Chapter 2 Assemblers System Software by Leland L. Beck Chapter 2 1 Role of Assembler Source Program Assembler Object Code Linker Executable Code Loader 2 Chapter 2 -- Outline Basic Assembler Functions Machine-dependent

More information

Chapter 2. Assembler Design

Chapter 2. Assembler Design Chapter 2 Assembler Design Assembler is system software which is used to convert an assembly language program to its equivalent object code. The input to the assembler is a source code written in assembly

More information

UNIT II ASSEMBLERS. Figure Assembler

UNIT II ASSEMBLERS. Figure Assembler 2.1 Basic assembler functions UNIT II ASSEMBLERS Assembler Assembler which converts assembly language programs into object files. Object files contain a combination of machine instructions, data, and information

More information

Gechstudentszone.wordpress.com

Gechstudentszone.wordpress.com CHAPTER -2 2.1 Basic Assembler Functions: The basic assembler functions are: ASSEMBLERS-1 Translating mnemonic language code to its equivalent object code. Assigning machine addresses to symbolic labels.

More information

CS2304-SYSTEM SOFTWARE 2 MARK QUESTION & ANSWERS. UNIT I INTRODUCTION

CS2304-SYSTEM SOFTWARE 2 MARK QUESTION & ANSWERS. UNIT I INTRODUCTION CS2304-SYSTEM SOFTWARE 2 MARK QUESTION & ANSWERS. UNIT I INTRODUCTION 1. Define System Software. System software consists of a variety of programs that supports the operations of a computer. Eg. Compiler,

More information

1.Program to find factorial of a given number

1.Program to find factorial of a given number 1.Program to find factorial of a given number DATA SEGMENT X DW 06H FACT DW? DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DATA MOV DS,AX MOV AX,01H ;Set the value of AX as 01H. MOV CX,X

More information

System Programming. System Software: An Introduction to Systems Programming. Leland L. Beck 3rd Edition Addison-Wesley, 1997

System Programming. System Software: An Introduction to Systems Programming. Leland L. Beck 3rd Edition Addison-Wesley, 1997 System Programming System Software: An Introduction to Systems Programming Leland L. Beck 3rd Edition Addison-Wesley, 1997 1 http://web.thu.edu.tw/ctyang/ 2 http://hpc.csie.thu.edu.tw/ 3 Score List Participation:

More information

2.1. Basic Assembler Functions:

2.1. Basic Assembler Functions: 2.1. Basic Assembler Functions: The basic assembler functions are: Translating mnemonic language code to its equivalent object code. Assigning machine addresses to symbolic labels. SOURCE PROGRAM ASSEMBLER

More information

UNIT 1: MACHINE ARCHITECTURE

UNIT 1: MACHINE ARCHITECTURE VTU QUESTION PAPER SOLUTION UNIT 1: MACHINE ARCHITECTURE 1. a) Give the target address generated for the following machine instruction: (i) 032600h (ii) 03C300h (iii) 0310C303h if (B)=006000, (PC)=003000,

More information

Machine dependent Assembler Features

Machine dependent Assembler Features Machine dependent Assembler Features Assembler Features Machine Dependent Assembler Features Instruction formats and addressing modes (SIC/XE) Program relocation Machine Independent Assembler Features

More information

PESIT SOUTHCAMPUS 10CS52: SYSTEM SOFTWARE QUESTION BANK

PESIT SOUTHCAMPUS 10CS52: SYSTEM SOFTWARE QUESTION BANK CS52: SYSTEM SOFTWARE QUESTION BANK Chapter1: MACHINE ARCHITECTURE OBJECTIVE: Main Objective is to Know about the system software and architecture of Various Machines Like SIC, SIC/XE and Programming examples

More information

UNIT I - INTRODUCTION

UNIT I - INTRODUCTION UNIT I - INTRODUCTION 1. Define system software. It consists of variety of programs that supports the operation of the computer. This software makes it possible for the user to focus on the other problems

More information

Chapter 3 Loaders and Linkers -- Machine-Dependent Loader Feature

Chapter 3 Loaders and Linkers -- Machine-Dependent Loader Feature Chapter 3 Loaders and Linkers -- Machine-Dependent Loader Feature Motivation Shortcoming of an absolute loader Programmer needs to specify the actual address at which it will be loaded into memory. It

More information

PESIT Bangalore South Campus Department of MCA Course Information for. System Programming (13MCA24)

PESIT Bangalore South Campus Department of MCA Course Information for. System Programming (13MCA24) PESIT Bangalore South Campus Department of MCA Course Information for System Programming (13MCA24) 1.GENERAL INFORMATION Academic Year: 2015 Semester(s): 2 nd Title Code Duration (hrs) Lectures 48 Hrs

More information

UNIT 1: MACHINE ARCHITECTURE

UNIT 1: MACHINE ARCHITECTURE VTU QUESTION PAPER SOLUTION UNIT 1: MACHINE ARCHITECTURE 1. Give the target address generated for the following machine instruction: (i) 032600h (ii) 03C300h (iii) 0310C303h if (B)=006000, (PC)=003000,

More information

CSI 402 Lecture 5 (Assemblers Continued) 5 1 / 18

CSI 402 Lecture 5 (Assemblers Continued) 5 1 / 18 CSI 402 Lecture 5 (Assemblers Continued) 5 1 / 18 Program Relocation Example 1: Consider the SIC instruction LDA THREE Assume the following: The START directive specifies the value 100 (decimal) The LC

More information

AS-2883 B.Sc.(Hon s)(fifth Semester) Examination,2013 Computer Science (PCSC-503) (System Software) [Time Allowed: Three Hours] [Maximum Marks : 30]

AS-2883 B.Sc.(Hon s)(fifth Semester) Examination,2013 Computer Science (PCSC-503) (System Software) [Time Allowed: Three Hours] [Maximum Marks : 30] AS-2883 B.Sc.(Hon s)(fifth Semester) Examination,2013 Computer Science (PCSC-503) (System Software) [Time Allowed: Three Hours] [Maximum Marks : 30] Note: Question Number 1 is compulsory. Marks : 10X1

More information

Chapter 3 Loaders and Linkers

Chapter 3 Loaders and Linkers Chapter 3 Loaders and Linkers Outline 3.1 Basic Loader Functions 3.2 Machine-Dependent Loader Features 3.3 Machine-Independent Loader Features 3.4 Loader Design Options 3.5 Implementation Examples Introduction

More information

An Assembler Written in SAS Ed Heaton, Westat, Rockville, MD

An Assembler Written in SAS Ed Heaton, Westat, Rockville, MD Paper 607 An Assembler Written in SAS Ed Heaton, Westat, Rockville, MD ABSTRACT Is SAS a programming language, i.e. can it handle problems typically in the domain of a real language like C? To prove the

More information

Systems Programming Assemblers Part 3-3 Program Blocks

Systems Programming Assemblers Part 3-3 Program Blocks Systems Programming Assemblers Part 3-3 Program Blocks Prof. Dr. Hani Mahdi Department of Computer Science Al-Isra University, Amman, Jordan Assembler Design 2. Basic Assembler Functions 2.2 Machine Dependent

More information

Chapter 3 Loaders and Linkers

Chapter 3 Loaders and Linkers Chapter 3 Loaders and Linkers Outline 3.1 Basic Loader Functions 3.2 Machine-Dependent Loader Features 3.3 Machine-Independent Loader Features 3.4 Loader Design Options 3.5 Implementation Examples Introduction

More information

國立嘉義大學資訊工程學系系統程式期中考考卷

國立嘉義大學資訊工程學系系統程式期中考考卷 國立嘉義大學資訊工程學系系統程式期中考考卷 學號 : 姓名 : 1. Please write the content in the lines. (25%) PROGB START EXTDEF B1, B2 EXTREF A1 LDA B1 +LDA A1 STA B1 +STA A1 B1 WORD 7 BUF RESB 1 B2 RESW 1 MAX EQU 1 END H^PROGA^^

More information

CS1203-SYSTEM SOFTWARE UNIT I-INTRODUCTION

CS1203-SYSTEM SOFTWARE UNIT I-INTRODUCTION CS1203-SYSTEM SOFTWARE UNIT I-INTRODUCTION 1. Define system software. It consists of variety of programs that supports the operation of the computer. This software makes it possible for the user to focus

More information

UNIT III - LOADERS AND LINKERS

UNIT III - LOADERS AND LINKERS 3.1 Introduction to Loaders UNIT III - LOADERS AND LINKERS A loader is the part of an operating system that is responsible for loading programs into memory and prepares them for execution. Loading a program

More information

Prepared By : Ms. Sanchari Saha ( Asst. Professor) Department : Computer Science & Engineering

Prepared By : Ms. Sanchari Saha ( Asst. Professor) Department : Computer Science & Engineering Subject Name: System Software Subject Code: 10CS52 Prepared By : Ms. Sanchari Saha ( Asst. Professor) Department : Computer Science & Engineering Date : 20-10-2014 UNIT-4 LOADERS & LINKERS Engineered for

More information

COMPILERS BASIC COMPILER FUNCTIONS

COMPILERS BASIC COMPILER FUNCTIONS COMPILERS BASIC COMPILER FUNCTIONS A compiler accepts a program written in a high level language as input and produces its machine language equivalent as output. For the purpose of compiler construction,

More information

8.7 TM: A SIMPLE TARGET MACHINE

8.7 TM: A SIMPLE TARGET MACHINE 8.7 TM: A SIMPLE TARGET MACHINE In the section following this one we will present a code generator for the TINY language. In order to make this a meaningful task, we generate target code directly for a

More information

Assembler Design Options

Assembler Design Options Assembler Design Options One and Multi-Pass Assembler So far, we have presented the design and implementation of a two-pass assembler. Here, we will present the design and implementation of One-pass assembler

More information

System Software DCAP507

System Software DCAP507 System Software DCAP507 SYSTEM SOFTWARE Copyright 2012 Dharminder Kumar All rights reserved Produced & Printed by EXCEL BOOKS PRIVATE LIMITED A-45, Naraina, Phase-I, New Delhi-110028 for Lovely Professional

More information

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1 CSIS1120A 10. Instruction Set & Addressing Mode CSIS1120A 10. Instruction Set & Addressing Mode 1 Elements of a Machine Instruction Operation Code specifies the operation to be performed, e.g. ADD, SUB

More information

Chapter 2 Assemblers Assembler Design Options

Chapter 2 Assemblers Assembler Design Options Chapter 2 Assemblers -- 2.4 Assembler Design Options Outline One-pass assemblers Multi-pass assemblers Two-pass assembler with overlay structure Load-and-Go Assembler Load-and-go assembler generates their

More information

Chapter 3 Loaders and Linkers

Chapter 3 Loaders and Linkers Chapter 3 Loaders and Linkers Three fundamental processes: Loading brings the object program into memory for execution. Relocation modifies the object program so that it can be loaded at an address different

More information

COMPUTER ORGANIZATION & ARCHITECTURE

COMPUTER ORGANIZATION & ARCHITECTURE COMPUTER ORGANIZATION & ARCHITECTURE Instructions Sets Architecture Lesson 5a 1 What are Instruction Sets The complete collection of instructions that are understood by a CPU Can be considered as a functional

More information

ASSEMBLERS. Prof. S.J. Soni, SPCE, Visnagar

ASSEMBLERS. Prof. S.J. Soni, SPCE, Visnagar ASSEMBLERS Prof. S.J. Soni, SPCE, Visnagar Design Specifications Identify the information necessary to perform a task Design a suitable data structure to record the information Determine the processing

More information

Systems Programming Assemblers Part 4 Control Sections

Systems Programming Assemblers Part 4 Control Sections Systems Programming Assemblers Part 4 Control Sections Prof. Dr. Hani Mahdi Department of Computer Science Al-Isra University, Amman, Jordan 1 1 Control Sections A Control Section is a part of the program

More information

LOADERS AND LINKERS 1. BASIC LOADER FUNCTIONS 2. DESIGN OF AN ABSOLUTE LOADER 3. A SIMPLE BOOTSTRAP LOADER 4. MACHINE DEPENDENT LOADER FEATURES

LOADERS AND LINKERS 1. BASIC LOADER FUNCTIONS 2. DESIGN OF AN ABSOLUTE LOADER 3. A SIMPLE BOOTSTRAP LOADER 4. MACHINE DEPENDENT LOADER FEATURES UIT III LOADERS AD LIKERS 1. BASIC LOADER FUCTIOS 2. DESIG OF A ABSOLUTE LOADER 3. A SIMPLE BOOTSTRAP LOADER 4. MACHIE DEPEDET LOADER FEATURES 5. RELOCATIO 6. PROGRAM LIKIG 7. ALGORITHM AD DATA STRUCTURES

More information

COS 140: Foundations of Computer Science

COS 140: Foundations of Computer Science COS 140: Foundations of Computer Science CPU Organization and Assembly Language Fall 2018 CPU 3 Components of the CPU..................................................... 4 Registers................................................................

More information

EC-801 Advanced Computer Architecture

EC-801 Advanced Computer Architecture EC-801 Advanced Computer Architecture Lecture 5 Instruction Set Architecture I Dr Hashim Ali Fall 2018 Department of Computer Science and Engineering HITEC University Taxila!1 Instruction Set Architecture

More information

Introduction. Chapter 4 Macro Processors -- Basic Macro Processor Functions. Macro expansion. Basic macro processor functions

Introduction. Chapter 4 Macro Processors -- Basic Macro Processor Functions. Macro expansion. Basic macro processor functions Introduction Chapter 4 Macro Processors -- Basic Macro Processor Functions Amacroinstruction(macro)isanotational convenience for the programmer Itallowstheprogrammertowriteshorthandversionofaprogram (module

More information

1 Little Man Computer

1 Little Man Computer 1 Little Man Computer Session 5 Reference Notes CPU Architecture and Assembly 1.1 Versions Little Man Computer is a widely used simulator of a (very simple) computer. There are a number of implementations.

More information

Assembly Language Programming of 8085

Assembly Language Programming of 8085 Assembly Language Programming of 8085 Topics 1. Introduction 2. Programming model of 8085 3. Instruction set of 8085 4. Example Programs 5. Addressing modes of 8085 6. Instruction & Data Formats of 8085

More information

UNIT III LOADERS AND LINKERS

UNIT III LOADERS AND LINKERS UNIT III LOADERS AND LINKERS INTRODUCTION Loader is a system program that performs the loading function. Many loaders also support relocation and linking. Some systems have a linker (linkage editor) to

More information

Computer Organization CS 206 T Lec# 2: Instruction Sets

Computer Organization CS 206 T Lec# 2: Instruction Sets Computer Organization CS 206 T Lec# 2: Instruction Sets Topics What is an instruction set Elements of instruction Instruction Format Instruction types Types of operations Types of operand Addressing mode

More information

Assembly Language Programming of 8085

Assembly Language Programming of 8085 Assembly Language Programming of 8085 1. Introduction A microprocessor executes instructions given by the user Instructions should be in a language known to the microprocessor Microprocessor understands

More information

Instruction Sets: Characteristics and Functions Addressing Modes

Instruction Sets: Characteristics and Functions Addressing Modes Instruction Sets: Characteristics and Functions Addressing Modes Chapters 10 and 11, William Stallings Computer Organization and Architecture 7 th Edition What is an Instruction Set? The complete collection

More information

EC 413 Computer Organization

EC 413 Computer Organization EC 413 Computer Organization Review I Prof. Michel A. Kinsy Computing: The Art of Abstraction Application Algorithm Programming Language Operating System/Virtual Machine Instruction Set Architecture (ISA)

More information

UNIT I. Pune Vidyarthi Griha s COLLEGE OF ENGINEERING, NASHIK-4. 1

UNIT I. Pune Vidyarthi Griha s COLLEGE OF ENGINEERING, NASHIK-4. 1 Pune Vidyarthi Griha s COLLEGE OF ENGINEERING, NASHIK-4. 1 UNIT I Introduction: Components of System Software: Text editors, Loaders, Assemblers, Macro processors, Compilers, Debuggers. Machine Structure,

More information

CS2214 COMPUTER ARCHITECTURE & ORGANIZATION SPRING 2014

CS2214 COMPUTER ARCHITECTURE & ORGANIZATION SPRING 2014 B CS2214 COMPUTER ARCHITECTURE & ORGANIZATION SPRING 2014 DUE : March 3, 2014 READ : - Related sections of Chapter 2 - Related sections of Chapter 3 - Related sections of Appendix A - Related sections

More information

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad Introduction to MS-DOS Debugger DEBUG In this laboratory, we will use DEBUG program and learn how to: 1. Examine and modify the contents of the 8086 s internal registers, and dedicated parts of the memory

More information

Binghamton University. CS-140 Fall Pippin

Binghamton University. CS-140 Fall Pippin Pippin 1 Pippin Rick Decker and Stuart Hirshfield The Analytical Engine: An Introdution to Computer Science Using the Internet [1998] Imaginary Computer with a very simple architecture The final project

More information

Compiler, Assembler, and Linker

Compiler, Assembler, and Linker Compiler, Assembler, and Linker Minsoo Ryu Department of Computer Science and Engineering Hanyang University msryu@hanyang.ac.kr What is a Compilation? Preprocessor Compiler Assembler Linker Loader Contents

More information

Programming Model 2 A. Introduction

Programming Model 2 A. Introduction Programming Model 2 A. Introduction Objectives At the end of this lab you should be able to: Use direct and indirect addressing modes of accessing data in memory Create an iterative loop of instructions

More information

Lecture 4: Instruction Set Architecture

Lecture 4: Instruction Set Architecture Lecture 4: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation Reading: Textbook (5 th edition) Appendix A Appendix B (4 th edition)

More information

Instruction Set Architecture. "Speaking with the computer"

Instruction Set Architecture. Speaking with the computer Instruction Set Architecture "Speaking with the computer" The Instruction Set Architecture Application Compiler Instr. Set Proc. Operating System I/O system Instruction Set Architecture Digital Design

More information

Chapter 4. MARIE: An Introduction to a Simple Computer. Chapter 4 Objectives. 4.1 Introduction. 4.2 CPU Basics

Chapter 4. MARIE: An Introduction to a Simple Computer. Chapter 4 Objectives. 4.1 Introduction. 4.2 CPU Basics Chapter 4 Objectives Learn the components common to every modern computer system. Chapter 4 MARIE: An Introduction to a Simple Computer Be able to explain how each component contributes to program execution.

More information

Computer Science and Engineering 331. Midterm Examination #1. Fall Name: Solutions S.S.#:

Computer Science and Engineering 331. Midterm Examination #1. Fall Name: Solutions S.S.#: Computer Science and Engineering 331 Midterm Examination #1 Fall 2000 Name: Solutions S.S.#: 1 41 2 13 3 18 4 28 Total 100 Instructions: This exam contains 4 questions. It is closed book and notes. Calculators

More information

ISA: The Hardware Software Interface

ISA: The Hardware Software Interface ISA: The Hardware Software Interface Instruction Set Architecture (ISA) is where software meets hardware In embedded systems, this boundary is often flexible Understanding of ISA design is therefore important

More information

Blog -

Blog - . Instruction Codes Every different processor type has its own design (different registers, buses, microoperations, machine instructions, etc) Modern processor is a very complex device It contains Many

More information

Assembly Language. Prof. Dr. Antônio Augusto Fröhlich. Sep 2006

Assembly Language. Prof. Dr. Antônio Augusto Fröhlich.   Sep 2006 Sep 2006 Prof. Antônio Augusto Fröhlich (http://www.lisha.ufsc.br) 33 Assembly Language Prof. Dr. Antônio Augusto Fröhlich guto@lisha.ufsc.br http://www.lisha.ufsc.br/~guto Sep 2006 Sep 2006 Prof. Antônio

More information

Computer Organization and Architecture (CSCI-365) Sample Final Exam

Computer Organization and Architecture (CSCI-365) Sample Final Exam Computer Organization and Architecture (CSCI-365) Sample Final Exam NAME: STUDENT NUMBER 1. Consider a computer system with 64Kbytes main memory and 256bytes cache. If we assume the cache line size is

More information

SCRAM Introduction. Philipp Koehn. 19 February 2018

SCRAM Introduction. Philipp Koehn. 19 February 2018 SCRAM Introduction Philipp Koehn 19 February 2018 This eek 1 Fully work through a computer circuit assembly code Simple but Complete Random Access Machine (SCRAM) every instruction is 8 bit 4 bit for op-code:

More information

Chapter 2 Assemblers. PDF created with FinePrint pdffactory Pro trial version

Chapter 2 Assemblers. PDF created with FinePrint pdffactory Pro trial version Chapter 2 Assemblers 1 PDF created with FinePrint pdffactry Pr trial versin www.pdffactry.cm Outline 2.1 Basic Assembler Functins 2.2 Machine-Dependent Assembler Features 2.3 Machine-Independent Assembler

More information

Instruction-set Design Issues: what is the ML instruction format(s) ML instruction Opcode Dest. Operand Source Operand 1...

Instruction-set Design Issues: what is the ML instruction format(s) ML instruction Opcode Dest. Operand Source Operand 1... Instruction-set Design Issues: what is the format(s) Opcode Dest. Operand Source Operand 1... 1) Which instructions to include: How many? Complexity - simple ADD R1, R2, R3 complex e.g., VAX MATCHC substrlength,

More information

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 11 Instruction Sets: Addressing Modes and Formats

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 11 Instruction Sets: Addressing Modes and Formats William Stallings Computer Organization and Architecture 8 th Edition Chapter 11 Instruction Sets: Addressing Modes and Formats Addressing Modes Immediate Direct Indirect Register Register Indirect Displacement

More information

Computer Organization and Architecture, Pt. 2

Computer Organization and Architecture, Pt. 2 Computer Organization and Architecture, Pt. 2 Charles Abzug, Ph.D. Department of Computer Science James Madison University Harrisonburg, VA 22807 Voice Phone: 540-568-8746, E-mail: CharlesAbzug@ACM.org

More information

THE MICROPROCESSOR Von Neumann s Architecture Model

THE MICROPROCESSOR Von Neumann s Architecture Model THE ICROPROCESSOR Von Neumann s Architecture odel Input/Output unit Provides instructions and data emory unit Stores both instructions and data Arithmetic and logic unit Processes everything Control unit

More information

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008 Math 230 Assembly Programming (AKA Computer Organization) Spring 2008 MIPS Intro II Lect 10 Feb 15, 2008 Adapted from slides developed for: Mary J. Irwin PSU CSE331 Dave Patterson s UCB CS152 M230 L10.1

More information

17. Instruction Sets: Characteristics and Functions

17. Instruction Sets: Characteristics and Functions 17. Instruction Sets: Characteristics and Functions Chapter 12 Spring 2016 CS430 - Computer Architecture 1 Introduction Section 12.1, 12.2, and 12.3 pp. 406-418 Computer Designer: Machine instruction set

More information

Reminder: tutorials start next week!

Reminder: tutorials start next week! Previous lecture recap! Metrics of computer architecture! Fundamental ways of improving performance: parallelism, locality, focus on the common case! Amdahl s Law: speedup proportional only to the affected

More information

Computer Architecture /

Computer Architecture / Computer Architecture 02-201 / 02-601 The Conceptual Architecture of a Computer PC CPU register 0 register 1 register 2 registers hold small amounts of data for processing by the CPU Reading / writing

More information

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers o How to disassemble an MC9S12 instruction sequence o Binary numbers are a code and represent what the programmer intends for the

More information

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers o How to disassemble an MC9S12 instruction sequence o Binary numbers are a code and represent what the programmer intends for the

More information

Chapter 4. MARIE: An Introduction to a Simple Computer

Chapter 4. MARIE: An Introduction to a Simple Computer Chapter 4 MARIE: An Introduction to a Simple Computer Chapter 4 Objectives Learn the components common to every modern computer system. Be able to explain how each component contributes to program execution.

More information

UNIT-IV: MACRO PROCESSOR

UNIT-IV: MACRO PROCESSOR UNIT-IV: MACRO PROCESSOR A Macro represents a commonly used group of statements in the source programming language. A macro instruction (macro) is a notational convenience for the programmer o It allows

More information

This contains the following three processes, and they are,

This contains the following three processes, and they are, Chapter 3 Loaders and Linkers This Chapter gives you Basic Loader Functions Machine-Dependent Loader Features Machine-Independent Loader Features Loader Design Options Implementation Examples 30 Introduction

More information

Computer Organization and Technology Processor and System Structures

Computer Organization and Technology Processor and System Structures Computer Organization and Technology Processor and System Structures Assoc. Prof. Dr. Wattanapong Kurdthongmee Division of Computer Engineering, School of Engineering and Resources, Walailak University

More information

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller of 8085 microprocessor 8085 is pronounced as "eighty-eighty-five" microprocessor. It is an 8-bit microprocessor designed by Intel in 1977 using NMOS technology. It has the following configuration 8-bit

More information

Chapter 2A Instructions: Language of the Computer

Chapter 2A Instructions: Language of the Computer Chapter 2A Instructions: Language of the Computer Copyright 2009 Elsevier, Inc. All rights reserved. Instruction Set The repertoire of instructions of a computer Different computers have different instruction

More information

Lecture 5: Instruction Set Architectures II. Take QUIZ 2 before 11:59pm today over Chapter 1 Quiz 1: 100% - 29; 80% - 25; 60% - 17; 40% - 3

Lecture 5: Instruction Set Architectures II. Take QUIZ 2 before 11:59pm today over Chapter 1 Quiz 1: 100% - 29; 80% - 25; 60% - 17; 40% - 3 Lecture 5: Instruction Set Architectures II Announcements Turn in Homework #1 XSPIM tutorials in PAI 5.38 during TA office hours Tue Feb 2: 2-3:30pm Wed Feb 3: 1:30-3pm Thu Feb 4: 3-4:30pm Take QUIZ 2

More information

Programming of 8085 microprocessor and 8051 micro controller Study material

Programming of 8085 microprocessor and 8051 micro controller Study material 8085 Demo Programs Now, let us take a look at some program demonstrations using the above instructions Adding Two 8-bit Numbers Write a program to add data at 3005H & 3006H memory location and store the

More information

Lecture 20: AVR Programming, Continued. AVR Program Visible State (ones we care about for now)

Lecture 20: AVR Programming, Continued. AVR Program Visible State (ones we care about for now) 18 100 Lecture 20: AVR Programming, Continued S 15 L20 1 James C. Hoe Dept of ECE, CMU April 2, 2015 Today s Goal: You will all be ace AVR hackers! Announcements: Midterm 2 can be picked up in lab and

More information

Computer Organization II CMSC 3833 Lecture 33

Computer Organization II CMSC 3833 Lecture 33 Term MARIE Definition Machine Architecture that is Really Intuitive and Easy 4.8.1 The Architecture Figure s Architecture Characteristics: Binary, two s complement Stored program, fixed word length Word

More information

MARIE: An Introduction to a Simple Computer

MARIE: An Introduction to a Simple Computer MARIE: An Introduction to a Simple Computer Outline Learn the components common to every modern computer system. Be able to explain how each component contributes to program execution. Understand a simple

More information

Loaders. Systems Programming. Outline. Basic Loader Functions

Loaders. Systems Programming. Outline. Basic Loader Functions Loaders Systems Programming Chapter 3 Linkers and Loaders A loader is a system program that performs the loading function. many also support relocation & linking others have a separate linker and loader

More information

Instruction Sets Ch 9-10

Instruction Sets Ch 9-10 Instruction Sets Ch 9-10 Characteristics Operands Operations Addressing Instruction Formats 1 Instruction Set (käskykanta) Collection of instructions that CPU understands Only interface to CPU from outside

More information

Instruction Sets Ch 9-10

Instruction Sets Ch 9-10 Instruction Sets Ch 9-10 Characteristics Operands Operations Addressing Instruction Formats 1 Instruction Set (käskykanta) Collection of instructions that CPU understands Only interface to CPU from outside

More information

Computer Organization

Computer Organization Computer Organization (Instruction set Architecture & Assembly Language Programming) KR Chowdhary Professor & Head Email: kr.chowdhary@gmail.com webpage: krchowdhary.com Department of Computer Science

More information

INSTRUCTION SET OF 8085

INSTRUCTION SET OF 8085 INSTRUCTION SET OF 8085 Instruction Set of 8085 An instruction is a binary pattern designed inside a microprocessor to perform a specific function. The entire group of instructions that a microprocessor

More information