Questions tagged [pcspim]
57 questions
0
votes
1 answer
checking Yes/No input for PCSpim
I am trying to figure out the best way to check user input in assembly language for PCSpim, for a programming assignment. Basically, I will prompt the user to enter whether or not they would like the display to be in ascending order. If they type…

user2109706
- 115
- 1
- 1
- 11
0
votes
2 answers
Assembly Program: Recursion?
I need to write a program that will iterate 10 times. Each time it will update a value and print it to the screen.
I know there has to do something with creating a stack and saving the the value so it can iterate back and get to the correct portion…

CoffeePeddlerIntern
- 659
- 3
- 13
- 29
0
votes
1 answer
Memory Out of bound error
Possible Duplicate:
Compile time initialized array error
I am trying to load data from a compiled time initialized array. But when I try to load the data, I get "Memory OUt of bound error". Here is the code:
.data
array: .space…

Naruto
- 1,710
- 7
- 28
- 39
0
votes
1 answer
Compile time initialized array error
I am trying to make an array to which I have provided the data at compile time in MIPS. but I am getting error and thus the code is not getting compiled. Here is the chunk of code which is causing error.
.data
array: .space…

Naruto
- 1,710
- 7
- 28
- 39
0
votes
1 answer
Converting C++ code to Mips
I am converting a C++ project in Mips assembly language. In c++ you can initialize an array like
int array[5]={1,2,3,4,5};
How can I initialize an array of characters in MIPS assembly language?

Naruto
- 1,710
- 7
- 28
- 39
0
votes
1 answer
User Prompt is not appearing on Screen
I made a program in which I am using an array. The problem is the program is not displaying a prompt on the screen which it should. Before I used array in this program, the prompt was working properly. Here is the code:
.data
User: .asciiz…

Naruto
- 1,710
- 7
- 28
- 39
0
votes
1 answer
How to store a String in a String Label
I am writing a program in which user inputs a string. This string is stored in a register $v0 by default, but I want to copy the data inside $v0 to String label, so that if I use $v0 for other purpose in the program, the user input doesn't get…

user1698102
- 127
- 2
- 4
- 9
-1
votes
1 answer
Identify original text, assembled code and machine code in QtSPIM simulator
I am using QtSPIM to learn assembly language.
An screenshot of PC SPIM text segment
How can I identify which part of this line is the original text, assembled code and machine code?
What are the major difference between assembled code and machine…

Eisha Enan
- 3
- 1
-1
votes
2 answers
Displaying number in Binary by shifting
I made a program in which I try to display the binary form of a number input by user. But the program isn't doing the masking correctly. What should I do to solve it?
user input in $s0
Loop:
and $t0,$s0,2147483648 // anding it with this number…

Naruto
- 1,710
- 7
- 28
- 39
-2
votes
1 answer
Compute 13*x by shifting and adding
I am just starting to learn assembly and having trouble getting this code to work so if anyone could help me out that would me much appreciated.
main:
ori $5,$0,x
addu $10,$0,$5
sll $5,3,shft
addu $10, $0, $5
sll $5,2,shft
addu $10,$0 ,$5…

user1984103
- 57
- 1
- 3
- 6
-3
votes
1 answer
Assembly asciiz pcspim
Write a program that reads 10 numbers from the keyboard and store them in memory. Then it prints the numbers in reverse order and print their sum. In addition to indicate a variable which takes as argument a letter of the alphabet and print the…
-4
votes
1 answer
Struggling with 2D arrays in assembly
I am trying to implement the following in MIPS
X is a two-dimensional array (matrix) of double-precision floating-point
numbers and Y is two-dimensional array of 32-bit integers.
Trying to write code for the following
Z= (X[i][j] + Y[i][j])
Now I…

Bic B
- 201
- 2
- 6
- 18