Write program that will process macros in assembly language

Assignment Help Assembly Language
Reference no: EM131492216

Assignment: Macro Pre-Processor for CS4800 Assembler

Write a program that will process the macros in a CS4800 Assembly Language program. The macro format is described below.

Input: A CS4800 Assembly Language Program with or without Macros.

Output: A CS4800 Assembly Language Program with any Macros expanded.
A listing of the macro name table (pointers may be ignored)
A listing of the macro table (pointers may be ignored)

Macro Format:

.MACRO MacroName [Parameter List]

Macro Body

.ENDM [MacroName]

The MacroName is a label.
The Parameter List is a list of no more that 12 labels separated by commas.
The Macro Body is a sequence of CS4800 Assembly Language instructions including directives.

Labels used on lines in the Macro Body will be designated in the parameter list prefixed by a $. The macro processor will generate a label to replace the label in the Macro expansion.

Parameters may be used anywhere in the Macro Body. But, if the parameter is to be concatenated to other objects in the body, the parameter and the object must be separated by a tic (‘) . Two parameters concatenated are separated by two tics(‘'). Otherwise, the parameter must stand alone as a part of an instruction.

There will be these additional assembler directives

.IF
.ENDIF

used for conditional assembly of macros. The operand for .IF will contain one of these binary operators

.EQ.         is textually equal
.LS.        is textually less than
.GT.         is textually greater than
or this unary operator
.EMPTY.         is the null string

.ENDIF        marks the end of the instructions that will be conditionally expanded.

The operands for these operators may be a formal parameter or a literal. A literal is delimited by slashes (/).
There will be no forward references to macros.
Macro calls may be nested but macro definitions may not.
If you wish, you may implement recursive macros for 20% extra credit.

Example Macros:

                     .MACRO    TESTCASE THIS, IS, PARAMETER, REG, $MYLABLE
                     .BYTE        10
                     .WORD     100,200,300
                     THIS         MYLABLE
                      ADD        IS
                     ST'REG     PARAMETER
MYLABLE:       INC'REG
                     .ENDM      TESTCASE

If invoked with

TESTCASE LDA, SOME, LABEL,, MINE

The expansion would look like this:

              .BYTE      10
              .WORD     100,200,300
              LDA         L30000
              ADD        SOME
              ST          L30000
L30000:  INC

Invoked a second time this way:
TESTCASE ADD, A, Y, X

               .BYTE      10
               .WORD    100,200,300
               ADD        L30001
               ADD        A
               STX         Y
L30001:   INCX

Thoroughly test your program. You may assemble the output from your macro
processor to show that the generated code is correct if you wish.

Turn in: A complete design document
Your macro processor code .
An executable version. Your test programs.
Your test output (include object code if you generate it).

Reference no: EM131492216

Questions Cloud

Making comparisons how do the operations of a central bank : Making Comparisons How do the operations of a central bank like the Fed compare to the operations of a normal bank?
How does the system of fractional reserves create money : The BIG Idea Why did the United States move to a single national currency in the 1860s?
Explain the significance of state bank : Explain the significance of state bank, legal tender, national bank, national currency, gold certificate, silver certificate, central bank, bank run.
Create a list of the ways you have used money : Functions of Money Create a list of the ways you have used money during the last week. Write the actions on a piece of paper. Next to each, identify which.
Write program that will process macros in assembly language : Write a program that will process the macros in a CS4800 Assembly Language program. The macro format is described below.
Why did the use of money replace the barter system : Drawing Conclusions Why did the use of money replace the barter system?
How does money advance the exchange of goods and services : Inferring Why would some people be more willing to accept commodity money rather than fiat money?
What is the external financing need : A firm's net assets equal 55% of sales. What is the external financing need?
Financial planning model will generally include : A financial planning model will generally include all of the following except the:

Reviews

Write a Review

Assembly Language Questions & Answers

  Create a assembly language subroutine

Create a assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n words and array C containing n long words

  Write a function in linux assembly

Write a function in Linux assembly

  Analog measurements

Prepare an assembly program for the correctly measures the wind direction

  Design a simple digital clock

Design a simple digital clock

  Write an assembly program

Prepare an Assembly program that reads in a number of cents.

  Write an assembly language program

Write an assembly language program for encrypting alphabates of a string

  Greatest common divisor of integers-masm assembly language

Must be done in MASM assembly language: Greatest common divisor of two integers is largest integer which will evenly divide both integers. GCD algorithm involves integer division in a loop.

  Write assembly program-find right admission price to movie

Write the Assembly program to find correct admission price to movie. Price of admission to a movie is $7 for kids (under 12) and $9 for adults.

  Create simple 8-bit alu using add-subtract-shift functions

Create a simple 8-bit ALU. Requirements:The eight functions that you will implement are: add, subtract, and, or, shift left logical, less than, shift right logical.

  Write assembly program print binary representation-integers

Write the assembly program called hw6_ex1, stored in file hw6_ex1.asm. This program must prompt user to enter signed 32-bit integer. Program must print out binary representation of the integer.

  Allot op-codes and add microcode to microprogram

Allot op-codes and add microcode to microprogram of Mic-1 to implement following instructions which are then included with IJVM instruction set.

  Write mips assembly program to read two non-negative numbers

Write MIPS assembly program to repeatedly read two non-negative integers and print integer product and quotient without using multiplication and division instructions.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd