Find Jobs
Hire Freelancers

Write C Program

$10-30 USD

Dokončeno
Zveřejněno před více než 5 roky

$10-30 USD

Zaplaceno při doručení
Write a C program to take as input (via stdin) a valid assignment statement in C and generate MIPS assembly code to perform the given calculation(s). You can assume that each C variable name is one lowercase letter (e.g., a, b, c, etc.) and of type int. Further, positive int constants are also allowed as part of the given expression. For this script, you only need to support the addition (+) and subtraction (-) operators. Note that you should use isspace(), islower(), isdigit(), scanf(), etc. to parse the input. The MIPS code you generate must make use of registers $s0,$s1,...,$s7 to correspond to C variables and registers $t0,$t1,...$t9 to correspond to any temporary variables you need. Variables in MIPS should match those in C from left to right, meaning that the final result of the script statement must end up in register $s0. You can assume that you will not need more than the specific MIPS registers listed here. Below are a few example runs of your program. In the first example, register $s0 corresponds to C variable f, $s1 corresponds to g, and $s2 corresponds to h. bash$ ./[login to view URL] Please enter a valid C assignment statement: f = g + h - 42; The MIPS pseudocode is: add $t0,$s1,$s2 sub $s0,$t0,42 bash$ ./[login to view URL] Please enter a valid C assignment statement: x = q - 12 + j; The MIPS pseudocode is: sub $t0,$s1,12 add $s0,$t0,$s2 bash$ ./[login to view URL] Please enter a valid C assignment statement: a = x - y + 13 + x - a; The MIPS pseudocode is: sub $t0,$s1,$s2 add $t1,$t0,13 add $t2,$t1,$s1 sub $s0,$t2,$s0
IČ projektu: 17905419

O projektu

2 nabídky
Vzdálený projekt
Aktivní před 6 roky

Chcete si vydělat nějaké peníze?

Výhody podávání nabídek na Freelancer

Stanovte si rozpočet a časový rámec
Získejte za svou práci zaplaceno
Načrtněte svůj návrh
Registrace a podávání nabídek je zdarma
Uděleno:
Avatar uživatele
Hi there this is Asad, if you are looking to get a good grade, contact me , would surely help you out.
$100 USD v 1 dni
5,0 (49 recenze)
6,1
6,1

O klientovi

Pochází z UNITED STATES
Somerville, United States
5,0
3
Ověřená platební metoda
Členem od kvě 17, 2016

Ověření klienta

Díky! Poslali jsme vám e-mailem odkaz pro získání kreditu zdarma.
Při odesílání e-mailu se něco pokazilo. Zkuste to prosím znovu.
Registrovaných uživatelů Zveřejněných projektů
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Načítání náhledu
Bylo uděleno povolení ke geolokaci.
Vaše doba přihlášení vypršela a byli jste odhlášeni. Přihlaste se znovu.