Find Jobs
Hire Freelancers

MIPS program from C code

$10-30 USD

Kapalı
İlan edilme: yaklaşık 3 yıl önce

$10-30 USD

Teslimde ödenir
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.
Proje No: 29810297

Proje hakkında

1 teklif
Uzaktan proje
Son aktiviteden bu yana geçen zaman 3 yıl önce

Biraz para mı kazanmak istiyorsunuz?

Freelancer'da teklif vermenin faydaları

Bütçenizi ve zaman çerçevenizi belirleyin
Çalışmanız için ödeme alın
Teklifinizin ana hatlarını belirleyin
Kaydolmak ve işlere teklif vermek ücretsizdir
1 freelancer bu proje için ortalama $50 USD teklif veriyor
Kullanıcı Avatarı
I can start now..................................................................................................
$50 USD 1 gün içinde
4,9 (55 değerlendirme)
4,9
4,9

Müşteri hakkında

   UNITED STATES bayrağı
Stockton, United States
5,0
3
Ödeme yöntemi onaylandı
Şub 16, 2021 tarihinden bu yana üye

Müşteri Doğrulaması

Teşekkürler! Ücretsiz kredinizi talep etmeniz için size bir bağlantı gönderdik.
E-postanız gönderilirken bir şeyler yanlış gitti. Lütfen tekrar deneyin.
Kayıtlı Kullanıcı İlan Edlien Toplam İş
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Ön izleme yükleniyor
Coğrafik konum için izin verildi.
Giriş oturumunuzun süresi doldu ve çıkış yaptınız. Lütfen tekrar giriş yapın.