Find Jobs
Hire Freelancers

MIPS program from C code

$10-30 USD

Cerrado
Publicado hace alrededor de 3 años

$10-30 USD

Pagado a la entrega
Write a complete MIPS program that implements the algorithm shown below (in C). To verify the output of the MIPS program, copy this C code and execute it. 1) int main() { int Z=2; int i; i=0; while(1){ if(i>20) break; Z++; i+=2; } do { Z++; } while (Z<100); while(i > 0) { Z--; i--; } return 0; } I and Z must be integer words in memory. 2) int main() { int A[5]; // Empty memory region for 5 elements int B[5] = {1,2,3,4,5}; int C=12; int i; for(i=0; i<5; i++) { A[i] = B[i] + C; } i--; while(i >= 0) { A[i]=A[i]*2; i--; } } A and B must be arrays of integer words in memory, but i can be a register. 3) int main() { char string[256]; int i=0; char *result = NULL; // NULL pointer is binary zero // Obtain string from user, e.g. "Constantinople" scanf("%255s", string); // Search string for letter 'e'. // Result is pointer to first e (if it exists) // or NULL pointer if it does not exist while(string[i] != '\0') { if(string[i] == 'e') { result = &string[i]; break; // exit from while loop early } i++; } if(result != NULL) { printf("First match at address %d\n", result); printf("The matching character is %c\n", *result); } else printf("No match found\n"); } The array of characters is an array of bytes, not words! The result pointer must be stored in memory when the program finishes.
ID del proyecto: 29810297

Información sobre el proyecto

1 propuesta
Proyecto remoto
Activo hace 3 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
1 freelancer está ofertando un promedio de $50 USD por este trabajo
Avatar del usuario
I can start now..................................................................................................
$50 USD en 1 día
4,9 (55 comentarios)
4,9
4,9

Sobre este cliente

Bandera de UNITED STATES
Stockton, United States
5,0
3
Forma de pago verificada
Miembro desde feb 16, 2021

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.