Q4) Suppose that you have a one-pass macro processor built into Pass 1 of a two-pass assembler. This macro processor implements nested definitions and nested invocations. Consider the following program(not SIC/XE machine) ALPHA MACRO &ALON, &BRUN SR &ALON, &BRUN GAMMA MACRO &XILT, &Y L VARM, &Y L GREL, &ALON AR &XILT, &Y MEND MEND BETA MACRO &R, &TANGO CR &R, &TANGO SHANE &R, &TANGO MEND SHANE MACRO &C, &D ALPHA &C, &D MEND NOPR 0 BETA 7,8 END (a) Show the macro name table (NAMTAB) and macro definition table (DEFTAB) as they appear when the line with the NOPR instruction is processed. (b) In expanding the invocation of BETA, the macro processor will eventually have to look at the line in the macro definition table that contains the AR instruction. Show NAMTAB and DEFTAB as they would appear at that instant. (c) Show that portion of the expansion of BETA 7,8 which Pass 2 of the assembler must consider in order to generate object code. (d) Suppose that the line "SHANE &R, &TANGO" in the definition of BETA were replaced by "BETA &R, &TANGO". This will cause a terrible thing to happen. Where will the bad thing happen? (Pass 1 of the assembler? Pass 2 of the program?) What would we see (error message or symptom) that would indicate that something had gone wrong?
Q4) Suppose that you have a one-pass macro processor built into Pass 1 of a two-pass assembler. This macro processor implements nested definitions and nested invocations. Consider the following program(not SIC/XE machine) ALPHA MACRO &ALON, &BRUN SR &ALON, &BRUN GAMMA MACRO &XILT, &Y L VARM, &Y L GREL, &ALON AR &XILT, &Y MEND MEND BETA MACRO &R, &TANGO CR &R, &TANGO SHANE &R, &TANGO MEND SHANE MACRO &C, &D ALPHA &C, &D MEND NOPR 0 BETA 7,8 END (a) Show the macro name table (NAMTAB) and macro definition table (DEFTAB) as they appear when the line with the NOPR instruction is processed. (b) In expanding the invocation of BETA, the macro processor will eventually have to look at the line in the macro definition table that contains the AR instruction. Show NAMTAB and DEFTAB as they would appear at that instant. (c) Show that portion of the expansion of BETA 7,8 which Pass 2 of the assembler must consider in order to generate object code. (d) Suppose that the line "SHANE &R, &TANGO" in the definition of BETA were replaced by "BETA &R, &TANGO". This will cause a terrible thing to happen. Where will the bad thing happen? (Pass 1 of the assembler? Pass 2 of the program?) What would we see (error message or symptom) that would indicate that something had gone wrong?
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Do not use AI .
if you are a specialist in the subject system programming . only answer if you are 100% sure.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 2 images
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education