39 Topics

Member Avatar for
Member Avatar for いわしろ

#include<stdio.h> #includ<conio.h> Int main() { int ch; float F,C,R,K; char chs; printf(“Choose Input Value\n1.F\n2.C\n3.R\n4.K\n”); scanf(“%d”,&ch); switch(ch) { Case1: F=input(“Fahrenheit value”); C=(5/9)*(F-32); K=C+273.15; R(9/5)*K; Case2: C=input(“Celsius value”); F=(9/5)*(F-32); K=C+273.15; R=(9/5)*K; Case3: R=input(“Rankine value”); F=R-459.67; C=(5/9)*(F-32); K=C+273.15; Case4: K=input(“Kelvin value”); R=(9/5)*K; F=R-459.67; C=(5/9)*(F-32); default: printf(“Invalid Input”) } fflush(stdin); printf(“Print final value F=%0.3f …

Member Avatar for rproffitt
0
63
Member Avatar for Yasmeen_4

Using mars (mips simulator) write a program using spim assembly language to read 20 integer numbers (positive and negative) store them in an array of 20 elements rnd compute the following on these numbers. 1. The count of positive numbers 2. the count of even numbers 3. print only numbers …

Member Avatar for Reverend Jim
0
221
Member Avatar for Belfina

Hello there guys! I must implement a linked list in assembly (using MIPS). We're supposed to dynamically allocate memory for the nodes. This is what I am asked to do: Write a program in assembly (MIPS) that implements a link-list. The client can choose among the following options. So the …

Member Avatar for rproffitt
0
6K
Member Avatar for SlimmC88

Hello Evreryone, I am new here and would love some help with a project I have. I have to create a MIPS program where we implement different funcntions. I was able to do strcopy but Im having trouble finding how to code the strchr, strcmp, and memset functions. Unfortunately I …

Member Avatar for rproffitt
0
847
Member Avatar for Alex_69

Basically title. Part of a larger program, but I can't figure out how to remove just the first letter (it's always not a number; A, B, C, X, etc.), and is always followed by numbers. So essentially, I'm trying to get "x234" to "234". I figured I could use lb …

Member Avatar for Alex_69
0
4K
Member Avatar for nandosss

i have a problem that i cant figure out how to solve it taht involves mips assembly. I need to ask the user for how many string they want to sort and then loop that many times and store all those strings in an array. I know how to ask …

Member Avatar for Nauman_4
-1
292
Member Avatar for Schol-R-LEA

One of the more common functions in any language is conversion of an integer to a string. This implementation, which demonstrates not only the common function activation record format but also a simple recursive function, was written in response to a recent question in which the OP posted an incomplete …

Member Avatar for Kiệt
0
7K
Member Avatar for supermastereu

Hi. I need help to write one program in Assembly Mips. << read the characters typed by the user and store these characters a string. This string is later converted to an integer. If the user tries introducing non-valid characters (that is, other than the numerals 0 to 9) the …

Member Avatar for sDJh
0
433
Member Avatar for Pyler

Are these two instructions equivalent, i.e do they both do the exact same thing? `addi $s0,$s0,0` and `add $s0, $s0, $zero`

Member Avatar for Hiroshe
0
238
Member Avatar for pspwxp fan

Hi Daniweb, I'm new to Assembly level programming and have been given an assignment in MIPS. Having started to plan the assignment, I have come to a rather open ended question that I want your opinion on: given that one has only so many registers to work with on Assembly …

Member Avatar for Schol-R-LEA
0
277
Member Avatar for C-Money

I have been working on a code that takes three strings, copies one string into another, takes the length of one of the strings, then concatenates the three strings, copies them, and get there length, but there is a problem. I need it to display 'The three strings combined are: …

Member Avatar for C-Money
0
442
Member Avatar for C-Money

I am attempting to write a code with several different segment, such as combine two differents strings, compare two strings, find the length of a string. Right now, I am working on the part to get the string length, but when I run the code I have so far on …

Member Avatar for C-Money
0
13K
Member Avatar for VictorK19

I'm really new to MIPS, so I'm having a hard time reading and understanding the code. For my homework, I was asked to identify and corrects errors in the folllowing code which computes the fibonacci number with given n passed in register $a0, and return it in $v0. I was …

Member Avatar for turboscrew
0
5K
Member Avatar for Andrew_6

la $a1, answer li $v1, 4 syscall move $a0, $v0 # move value of recursion to print li $v0, 1 # print integer value syscall # executes print li $v0,10 # call to exit syscall # executes exit The uncommented section is the area giving me problems, answer is a …

Member Avatar for turboscrew
0
182
Member Avatar for ppajak

Hey guys, I wrote a program that reads a file and then displays its 8, 16 and 32 bit checksum as well as the XOR values. I've managed to do it and it works fine under windows(using qtspim) but on centos(using mars) I get the following errors: Line 7 column …

Member Avatar for Schol-R-LEA
0
5K
Member Avatar for globueno

Hi I am fairly new at programming, I am working on a final project for my assembly language class where I am calculating college savings, this is the formula I believe I will end up using, fv= pv(1+(r/n))^nt, but I am in desperate need of help in writing that in …

Member Avatar for Assembly Guy
0
1K
Member Avatar for newGains

pretty new to programming in assembly but my assignment is to write a GCD program but my program works sometimes and sometimes it doesn't work. if i put the smaller number first then the larger number i don't get the correct GCD but if i do the opposite i get …

0
155
Member Avatar for eggshell5150

I'm about at my wits' end trying to figure this out. This is homework, so any hints would be appreciated. I was tasked with filling in a few blocks of code (these are denoted by comment lines with a number resting in the middle) involving function calls in MIPS. The …

Member Avatar for eggshell5150
0
587
Member Avatar for ssfox

Hello everyone,I'm new in MIPS programming, can anyone show me how to write code for these two programs. 1)Write a procedure called order that accepts two arguments. The first argument is the address of the array and the second argument is the index of an array element i. The procedure …

Member Avatar for ssfox
0
202
Member Avatar for Bradoz

Assume that the variables a, b, c and d are signed integers held in registers $s0 to $s3 respectively and put the result of the expression into register $t0. Also assume that the result of the multiplication will fit in 32 bits. (a + 2) * (b + c) * …

0
124
Member Avatar for dark_sider_1

Hi there, I know this is probably a really stupid question, but I'm new to MIPS programming, and I was wondering, do you know if there's anything wrong with this code? This definitely isn't like high-level programming when the compiler shows you where the syntax error is. Not even sure …

Member Avatar for rubberman
0
678
Member Avatar for lxXTaCoXxl

Figured I've been working on material for a while and would throw these up for everyone that needs them in the future to use. It's very simple implementation; if I get enough people asking me to, I will write the methods for each of the instructions so you don't have …

Member Avatar for skatamatic
0
276
Member Avatar for userct

Hello, I'm trying to write a program using MIPS Assembly Language (I write the code in TextWrangler and run it in QTSpim) I was wondering how I would go about checking if a number is perfect or not. I know my first lines of code may be partially incorrect but …

0
480
Member Avatar for ambinh

Hi I am testing this function itoa, but I got infinite loop. Could anyone help me to fix this? Here is my code Code blocks are created by indenting at least 4 spaces ... and can span multiple lines .data result_str: .asciiz " " #reserve 12 spaces prompt: .asciiz "Enter …

0
142
Member Avatar for userct

I need to Compute 2x4 +7x3 -15x2 +3x+2 Using Horners Method. When I run this in QTSpim it doesn't give me any errors but I'm just wondering if everything is running completely right. For instance did I call "x" correctly? I'm trying to load the value for x from memory …

0
142
Member Avatar for scottd82

Hey everyone, I am trying to create a random number generator with MIPS assembly. I have most of the code written, I just need to change my set number for a guessing game to a random number. I also want to ask the user if they'd like to play again. …

0
543
Member Avatar for nandosss

I need help creating a two dimensional array in mips assembly. I am new to this kind of programming and i do not know how to approach the problem. i have to create an array max size 20 by 20 and then fill it up with data entered by the …

Member Avatar for Ancient Dragon
0
4K
Member Avatar for wasiqjaved

Hi, Need some help with MIPS I need to write a MIPS code that reads 10 characters string and then only print out value of 3rd, 5th and 7th character (remembering that first character is character 0) OUTPUT (should be somewhat like this): Enter 10 character string : i love …

Member Avatar for DeanMSands3
0
523
Member Avatar for scottd82

Hi everyone. I am doing my homework for my computer organization class and I'm running into a small problem. Before I explain what I've done, what I expect to happen and what is happening, I want to assure everyone that I am not looking for an answer to my homework, …

Member Avatar for Schol-R-LEA
0
352
Member Avatar for aizen92

Hello, I would like to know how can I put a binary number such as 110 in a register in MIPS? Thanks,

0
144

The End.