Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

here is the Shifter.cpp file and if you could not read my Shifter.cpp file here

ID: 3751210 • Letter: H

Question

here is the Shifter.cpp file

and if you could not read my Shifter.cpp file here is the code.


// BytesShifterC++InlineTemplateSolution.cpp : Defines the entry point for the console application.

#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <cstdint>

using namespace std;

void main()
{
    const uint8_t byte0(0x11), byte1(0x22), byte2(0x33), byte3(0x44);
           uint32_t resultUInt32(0);

    cout << hex;
    cout << "Byte 0 is " << (unsigned)byte0 << endl;
    cout << "Byte 1 is " << (unsigned)byte1 << endl;
    cout << "Byte 2 is " << (unsigned)byte2 << endl;
    cout << "Byte 3 is " << (unsigned)byte3 << endl << endl;

    _asm {
        ; Put the values of byte0, byte1, byte2, and byte3 into the C++ memory variable uint32_t resultUInt32.
        ; the order in the memory variable from most significant to least should be byte0 byte1 byte2 byte3

    }

    cout << "The placement result is " << resultUInt32 << endl << endl;

    const uint32_t source32Bit(0x44332211);
           uint8_t lowestAddressByte0Up = 0, lowestAddressByte1Up = 0, lowestAddressByte2Up = 0, lowestAddressByte3Up = 0;

    _asm {
        ; Step through by byte sizes the memory constant uint32_t source32Bit(0x44332211) from the lowest to the highest byte address
        ; and put the byte results into the coresponding C++ variables

    }

    cout << "In Memory little endian storage for " << source32Bit << "(LSB on right side)" << endl << endl;

    cout << "The lowest address byte is " << (unsigned)lowestAddressByte0Up << endl;
    cout << "The next up address byte is " << (unsigned)lowestAddressByte1Up << endl;
    cout << "The next up address byte is " << (unsigned)lowestAddressByte2Up << endl;
    cout << "The next up address byte is " << (unsigned)lowestAddressByte3Up << endl << endl;

    cout << dec;

    uint32_t multiplicand,
             exponentforBase2Multiplier,
             product;

    cout << "Enter an integer > = 0 for multiplicand : ";                      cin >> multiplicand;
    cout << "Enter an integer > = 0 to be an exponent for base 2 multiplier : "; cin >> exponentforBase2Multiplier;

    _asm {
        ; use shift opertor to mutiply by power of 2

    }

    cout << "Multiplicand " << multiplicand << " x 2 to the power of " << exponentforBase2Multiplier << " = " << product << endl << endl;

    uint32_t dividend,
             exponentforBase2Divisor,
             quotient;

    cout << "Enter an integer > = 0 for dividend : ";                      cin >> dividend;
    cout << "Enter an integer > = 0 to be an exponent for base 2 divisor : "; cin >> exponentforBase2Divisor;

    _asm {
        ; use shift opertor to divide by power of 2

    }

    cout << "Dividend " << dividend << " / 2 to the power of " << exponentforBase2Divisor << " = " << quotient << endl << endl;

}

COSC 2325 In this project dowaload the Shifter cpp file located within the assignment. Use this downloaded C++ program and program you create in Visual Studio. The Shifter.cpp file contains commented embedded assembler (asm) blocks. Write the required embedded (asm) assembler code for each section in the correspondimg inline assembler blocks denoted by the _asm keyword See the example displayed output at the end of this assignment for guidance. In the Explorer Visual Studio IDE Create a new solution project using the values: Bytes ShifterinineSolution CLabsiCOSC2325 In the text boxes in the screen below: New Project t Recent 4 Installed 4 Templates NET Framework 4 Sort by: Default .. Search Installed Templates Win32 Console Application Visual C. Type: Visual C A project for creating a 3Project Visual C++Win32 console application Visual C# s Visual Basic Visual F# 4 Visual C Windows ATL CLR General MFC Test Win32 Cross Platform Extensibility SOL Server o JavaScript 1 Python b Online Name: Location Solution name: lisk bers.se sosteklins and fand semslates. FytesShifter InlineSolution Browse Create directory for solution Create new Git repository ok Cancel Zip up the solution folder specified in the Name: tet box in the screen abore to use for submittal to Canvas.

Explanation / Answer

int main()

Edit & Run

and at the end of your program you must return 0; // obviously only if the program executed successfully