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
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
using namespace std;
void main() { const uint8_t byte0(0x11), byte1(0x22), byte2(0x33), byte3(0x44); uint32_t resultUInt32(0);
cout
_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
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
cout
cout
uint32_t multiplicand, exponentforBase2Multiplier, product;
cout = 0 for multiplicand : "; cin >> multiplicand; cout = 0 to be an exponent for base 2 multiplier : "; cin >> exponentforBase2Multiplier;
_asm { ; use shift opertor to mutiply by power of 2
}
cout
uint32_t dividend, exponentforBase2Divisor, quotient;
cout = 0 for dividend : "; cin >> dividend; cout = 0 to be an exponent for base 2 divisor : "; cin >> exponentforBase2Divisor;
_asm { ; use shift opertor to divide by power of 2
}
cout
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started