CS代考 UY 2214

CS-UY 2214

Starter code for E20 assembler

Copyright By PowCoder代写 加微信 powcoder

#include
#include
#include
#include
#include
#include

using namespace std;

print_line(address, num)
Print a line of machine code in the required format.
Parameters:
address = RAM address of the instructions
num = numeric value of machine instruction
void print_machine_code(unsigned address, unsigned num) {
bitset<16> instruction_in_binary(num);
cout << "ram[" << address << "] = 16'b" << instruction_in_binary <<";"< instructions;

string line;
while (getline(f, line)) {
size_t pos = line.find(“#”);
if (pos != string::npos)
line = line.substr(0, pos);
instructions.push_back(line.size()); // TODO change this. generate the machine code

/* print out each instruction in the required format */
unsigned address = 0;
for (unsigned instruction : instructions) {
print_machine_code(address, instruction);
address ++;

//ra0Eequ6ucie6Jei0koh6phishohm9

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com