EXPERIMENT NO : M/C Lenovo Think center M700 Ci3,6100,6th Gen. H81, 4GB RAM,500GB HDD

Similar documents
EXPERIMENT NO : 03. Design suitable data structures and implement pass-i of a two-pass macro-processor using OOP features in Java 2.

Pune Vidyarthi Griha s COLLEGE OF ENGINEERING, NASIK COMPUTER ENGINEERING DEPT. LAB MANUAL SYSTEM PROGRAMMING & OPERATING SYSTEM(310257) LABORATORY

GUJARAT TECHNOLOGICAL UNIVERSITY

z390 Macro Pseudo Code Support

PSD1C SYSTEM SOFTWAE UNIT: I - V PSD1C SYSTEM SOFTWARE

EXPERIMENT NO : M/C Lenovo Think center M700 Ci3,6100,6th Gen. H81, 4GB RAM,500GB HDD

QUESTION BANK CHAPTER 1 : OVERVIEW OF SYSTEM SOFTWARE. CHAPTER 2: Overview of Language Processors. CHAPTER 3: Assemblers

High Level Assembler for z/os & z/vm & z/vse. Language Reference. Version 1 Release 6 SC

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) WINTER-15 EXAMINATION Model Answer Paper

High Level Assembler for z/os & z/vm & z/vse. Language Reference. Version 1 Release 6 SC

SILVER OAK COLLEGE OF ENGINEERING & TECHNOLOGY ADITYA SILVER OAK INSTITUTE OF TECHNOLOGY

Assembler Language Macro "Boot Camp" Part 2

Assembler Language Macro "Boot Camp" Part 2. SHARE in Austin March 1-6, 2009 Session 8159

Name :. Roll No. :... Invigilator s Signature : INTRODUCTION TO PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

SILVER OAK COLLEGE OF ENGINEERING & TECHNOLOGY

EXPERIMENT NO : M/C Lenovo Think center M700 Ci3,6100,6th Gen. H81, 4GB RAM,500GB HDD

SIR C.R.REDDY COLLEGE OF ENGINEERING, ELURU DEPARTMENT OF INFORMATION TECHNOLOGY LESSON PLAN

//TWO PASS MACROPROCESSOR. import java.util.*; import java.io.*; class MntTuple { String name; int index;

EXPERIMENT NO : M/C Lenovo Think center M700 Ci3,6100,6th Gen. H81, 4GB RAM,500GB HDD

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

2) Save the Macro definition:- The processor must store the macro instruction definitions which it will need for expanding macro calls.

MODEL ANSWER SUMMER 17 EXAMINATION 17517

SC OS.Assembler H Messages. Program Product. Program Number 5734 AS1 . (

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) SUMMER-16 EXAMINATION Model Answer

III) EXAMINATION, 2015 CS 331 : SYSTEM PROGRAMMING AND OPERATING SYSTEM I

A Brief System z Assembler History

Q. State and Explain steps involved in program development. [w-08, w-10, s-12, w-11]

such a manner that we are able to understand, grasp and grapple with the problem at hand in a more organized fashion.

Assembler Language Macro "Boot Camp" Part 1

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

Computer Organization & Assembly Language Programming

UNIT IV -MACROPROCESSOR

Subroutine. Chapter 8

Lab manual for Subject: System Programming. Class : sixth semester(cse)

Compiler Design. Computer Science & Information Technology (CS) Rank under AIR 100

Processor design - MIPS

BITG 1113: Function (Part 2) LECTURE 5

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

SILVER OAK COLLEGE OF ENGINEERING & TECHNOLOGY

Macro Assembler. Defini3on from h6p://

Problem with Scanning an Infix Expression

ECE220: Computer Systems and Programming Spring 2018 Honors Section due: Saturday 14 April at 11:59:59 p.m. Code Generation for an LC-3 Compiler

SHARE Anaheim 2014 High Level Assembler Bootcamp (15250, 15251, 15252)

Students received individual feedback throughout year on assignments.

The Assembly Language Level. Chapter 7

Using REXX during Assembly

ORG ; TWO. Assembly Language Programming

Structured Programming in Assembler Session 16321

ADMINISTRATIVE MANAGEMENT COLLEGE

G Compiler Construction Lecture 4: Lexical Analysis. Mohamed Zahran (aka Z)

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

Sai Nath University. Assignment For MCA 2nd Sem.

Hrs Hrs Hrs Hrs Hrs Marks Marks Marks Marks Marks

Short Notes of CS201

KUE-CHIP SS: (start/stop) SI: SP: for observation(ob) DBi. DBo. for observation(ob) for observation(ob) DBi. DBi. DBo.

Chapter 2. Instructions:

Goals of this Lecture

CS201 - Introduction to Programming Glossary By

Lecture 8: RISC & Parallel Computers. Parallel computers

Assembler Language as a Higher Level Language: Conditional Assembly and Macro Techniques SHARE 115

SETcc Set Byte on Condition

EXAMINING THE CODE. 1. Examining the Design and Code 2. Formal Review: 3. Coding Standards and Guidelines: 4. Generic Code Review Checklist:

ASSIST /B ASSIST MARCH 1974 INTRODUCTORY ASSEMBLER USER'S MANUAL

1. Let n be a positive number. a. When we divide a decimal number, n, by 10, how are the numeral and the quotient related?

Chapter 2 Instruction Set Architecture

Chapter 6 Programming the LC-3

register allocation saves energy register allocation reduces memory accesses.

Code No: R Set No. 1

B.Sc II Year Computer Science (Optional)

sarm User Guide Note that a space must appear before the operation field because any word beginning in the first column is a label

CSCI-GA Compiler Construction Lecture 4: Lexical Analysis I. Hubertus Franke

EXAM Computer Science 1 Part 1

Machine Language Instructions Introduction. Instructions Words of a language understood by machine. Instruction set Vocabulary of the machine

There are algorithms, however, that need to execute statements in some other kind of ordering depending on certain conditions.

Address Modes effective address

COMP6700/2140 Control Flow

ECE232: Hardware Organization and Design

UNIT I - INTRODUCTION

Concepts Introduced in Chapter 3

CS 2504 Intro Computer Organization Test 1

Assembly Language. Instructor: Dmitri A. Gusev. Spring Lecture 10, February 27, CSC : Introduction to Computer Science

CS 61A Interpreters, Tail Calls, Macros, Streams, Iterators. Spring 2019 Guerrilla Section 5: April 20, Interpreters.

A model for of understanding the structure and function of paragraphs a tool for smashing through the barrier of writer s block!

Monday, February 16, 2015

DEPARTMENT OF COMPUTER AND MATHEMATICAL SCIENCES UNIVERSITI TEKNOLOGI MARA CAWANGAN PULAU PINANG

CPU Structure and Function. Chapter 12, William Stallings Computer Organization and Architecture 7 th Edition

CN310 Microprocessor Systems Design

Arrays: Higher Dimensional Arrays. CS0007: Introduction to Computer Programming

Assembler Directives

SIR C R REDDY COLLEGE OF ENGINEERING

ASSIST Assembler Replacement User s Guide

EECE416 :Microcomputer Fundamentals and Design. X86 Assembly Programming Part 1. Dr. Charles Kim

Instructions: MIPS ISA. Chapter 2 Instructions: Language of the Computer 1

Program Development. Chapter 5

COMP 201: Principles of Programming

Lecture-30 Assemblers To assemble a program automatically the assembler needs information in the form of assembler direct that controls the assembly.

Problem with Scanning an Infix Expression

CS 103 Unit 13 Slides

Introduction to Modules. Chapter 3. Defining and Calling a Module. Introduction to Modules. 5 Benefits of Modules. Modules CSUS, Spring 2016

SPOS MODEL ANSWER MAY 2018

Transcription:

GROUP - A EXPERIMENT NO : 04 1. Title: Write a Java program for pass-ii of a two-pass macro-processor. The output of assignment-3 (MNT, MDT and file without any macro definitions) should be input for this assignment 2. Objectives : - To understand Data structure Pass-2 macroprocessor - To understand Pass-1 & Pass-2 macroprocessor concept - To understand Advanced macro facility 3. Problem Statement : Write a Java program for pass-ii of a two-pass macro-processor. The output of assignment-3 (MNT, MDT and file without any macro definitions) should be input for this assignment 4. Outcomes: After completion of this assignment students will be able to: - Implemented Pass 2 macroprocessor - Implemented machine code from MDT and MNT table. - Understood concept Pass-2 macroprocessor. 5. Software Requirements: Latest jdk., Eclipse 6. Hardware Requirement: - M/C Lenovo Think center M700 Ci3,6100,6th Gen. H81, 4GB RAM,500GB HDD 7. Theory Concepts: Advanced Macro Facilities: (1) AIF (2) AGO (3) Sequential Symbol (4) Expansion time variable

(1) AIF Use the AIF instruction to branch according to the results of a condition test. You can thus alter the sequence in which source program statements or macro definition statements are processed by the assembler. The AIF instruction also provides loop control for conditional assembly processing, which lets you control the sequence of statements to be generated. It also lets you check for error conditions and thereby to branch to the appropriate MNOTE instruction to issue an error message. (2) AGO The AGO instruction branches unconditionally. You can thus alter the sequence in which your assembler language statements are processed. This provides you with final exits from conditional assembly loops. 3) Sequence Symbols You can use a sequence symbol in the name field of a statement to branch to that statement during conditional assembly processing, thus altering the sequence in which the assembler processes your conditional assembly and macro instructions. You can select the model statements from which the assembler generates assembler language statements for processing at assembly time. A sequence symbol consists of a period (.) followed by an alphabetic character, followed by 0 to 61 alphanumeric characters. Examples:.BRANCHING_LABEL#1.A Sequence symbols can be specified in the name field of assembler language statements and model statements; however, sequence symbols must not be used as name entries in the following assembler instructions: ALIAS EQU OPSYN SETC AREAD ICTL SETA SETAF CATTR LOCTR SETB SETCF DXD

Also, sequence symbols cannot be used as name entries in macro prototype instructions, or in any instruction that already contains an ordinary or a variable symbol in the name field. Sequence symbols can be specified in the operand field of an AIF or AGO instruction to branch to a statement with the same sequence symbol as a label 4) Expansion Time Variables Note :- write theory from book or notes. - Data Structures of Two Pass Macros: 1] Input Source Program for pass- II. It is produced by pass I. 2] Macro Definition Table : (MDT) produced by pass - I Location Counter(where MDTP points to start position of macro) Opcode Rest (i.e it will contain the other part than opcodes used in macro). 3] Macro Name Table : (MNT) produced by pass - I macro number(i.e pointer referenced from MNTP) Name of macros MDTP (i.e points to start position to MDT) 4] MNTP (macro name table pointer) gives number of entries in MNT. 5] Argument List Array : Index given to parameter Name of parameter Which gives association between integer indices & actual parameters. 6] Source Program with macro-calls expanded. This is output of pass- II. 7] MDTP (macro definition table pointer) gives the address of macro definition in macro definition table. Algorithm: Take Input from Pass - I Examine all statements in the assembly source program to detect macro calls. For Each Macro call: (a) Locate the macro name in MNT. (b) Establish correspondence between formal parameters & actual parameters. (c) Obtain information from MNT regarding position of the macro definition in MDT. (d) Expand the macro call by picking up model statements from MDT.

Example for pass I of macro processor: - Assembly Code Segment:- MACRO INCR &X,&Y,&REG=AREG MOVER &REG,&Y ADD &REG,&Y MOVEM &REG,&X MACRO DECR &A,&B,&REG=BREG MOVER &REG,&A ADD &REG,&B MOVEM &REG,&A START 200 READ N1 READ N2 INCR N1,N2,REG=CREG DECR N1,N2 STOP N1 DS 1 N2 DS 2 END Output of Pass-I of Macro Macro Processor:- MDT 0 1 MNT NAME ADDRESS IN MDT INCR 0 DECR 5 0 1 2 3 4 5 6 7 8 9 INCR &X,&Y,&REG=AREG MOVER #3,#1 ADD #3,#2 MOVEM #3,#1 DECR &A,&B,&REG=BREG MOVER #3,#1 ADD #3,#2 MOVEM #3,#1 #1 First Parameter #2 Second Parameter #3 Third Parameter

Pass II of macro pre-processor will create the argument list array, every time there is call to macro,& expand macro. (1) Macro Call:- INCR &X,&Y,&REG=AREG ALA:- N1 N2 AREG Attach expansion code of this macro in output as following:- MOVER AREG,N1 ADD AREG,N2 MOVEM AREG,N1 (2) Macro Call:- INCR &A,&B,&REG=BREG ALA:- N1 N2 BREG Attach expansion code of this macro in output as following:- MOVER BREG,N1 ADD BREG,N2 MOVEM BREG,N1 Expanded Source file at the end of pass II : START 200 READ N1 READ N2 MOVER AREG,N1 ADD AREG,N2 MOVEM AREG,N1 Expansion of INCR N1,N2

MOVER BREG,N1 ADD BREG,N2 MOVEM BREG,N1 Expansion of DECR N1,N2 STOP N1 DS 1 N2 DS 2 END Note : you can take other example also. Algorithms : Flowchart :. Note : you can also write your own theory respect to practical. 8. Conclusion : Thus, I have implemented Pass-2 macroprocessor by taking input as output of assignment-3 (i.e. MDT and MNT table) References : NOTE : don t write references. A P C/W TOTAL SIGN (3) (4) (3) (10) A Attendance, P Performance, C/W Completion & Writing Oral Questions: [Write short answer ] 1. What is Pass-2 macroprocessor 2. How does Pass-2 macroprocessor works. 3. What is MDT and MNT. 4. What is Argument List Array. 5. Working of Pass-2 macroprocessor 6. Compare Pass-1 and Pass-2 macroprocessor.