Questions tagged [pcspim]

57 questions
1
vote
0 answers

Get/Swap Array Elements in MIPS

I am very new to MIPS and this is a homework assignment, so I'm really just looking for a clue to get me going. :) I have looked around for similar questions but didn't find anything that was what I needed, so I'm sorry that this has been asked…
AbigailB
  • 339
  • 3
  • 4
  • 18
1
vote
2 answers

How to Display String array in MIPS

This is a very beginner program in MIPS programming in which I am trying to take input from user and display the input data on the screen. But when I run this program, I get "Memory out of bound error" and then program crashes when it tries to…
Naruto
  • 1,710
  • 7
  • 28
  • 39
1
vote
3 answers

Trying to write a basic main program using a function

I am trying to write a function to copy words from source memory to destination memory. I have written the function but I am having difficulty executing the code. It is giving me execption 4 as an error .data .text main: .setnoreorder …
WoLv3rine
  • 107
  • 1
  • 4
  • 9
0
votes
2 answers

MIPS Assembly - how to only accept integers between 1 and 15?

was wondering what instruction i would need to do to make sure the integers inputted from the user using PCspim would make sure only numbers 1-15 can be entered and if not display an error message? i have read the instructions such as SLT but i dont…
george767
  • 11
  • 1
  • 4
0
votes
0 answers

16 Bits ALU in MIPS

Here is the code I implement this code in PCSpim ## Two 16 bits value is assigned in data segment ## Provide Selector value in console window ## Result is displayed .text .globl main main: la $s1, value lb $t1, 0($s1) lb $t2,…
Rocky
  • 17
  • 4
0
votes
0 answers

MIPS- beq not branching to the proper function?

I'm very new to writing code in MIPS, so any help would be appreciated. I have been trying to a simple mips program, but my program seems to keep going to the else statement everytime. .text .globl __start __start: #…
0
votes
0 answers

Segmented Virtual Memory Addresses PC-SPIM Project

Can anyone help me get started with this homework project? It uses MIPS-R3000 assembly instructions and PC-SPIM. Any help is greatly appreciated! We are developing a software tool that performs the following activities (in the following order) using…
0
votes
0 answers

Logic Error with PCSPIM MIPS Assembly Language

I am working on a basic assembly language project, but I managed to mess up somewhere and the output always comes out as a FINE_FOUR (35 MPH+). If someone could help me debug this, I would really appreciate it. .data STR_FIRSTPROMPT: .asciiz…
quitme
  • 1
  • 2
0
votes
0 answers

Show division result in MIPS

Hi I'm coding a small program in MIPS and I have this code li $v0, 2 div $t0,$t2,$t1 move $a0,$t0 syscall (it's not the full code, just the section handling division) Where $t1 is 2, $t2 is 9. So, 2/9 is 0.2222222222222222 But when I run it I only…
Ashir
  • 511
  • 2
  • 8
  • 24
0
votes
0 answers

Unable to determine why floating point comparison is giving syntax error

Code is meant to loop, calculating fibonacci sequence based on user input(n). In PCSpim im receiving: (parser) syntax error on line 71 of file. c.ep.d $f0, $f8 s.d $f2, 0.0 #f0 - These two house the fibonacci f0 + f1 numbers throughout the loop …
0
votes
0 answers

Assembly compiling error on PCSpim simulator

i'm new to assembly and i'm studying it applied on MIPS. My university teacher gave us some codes. Here there is one. .data 0x100020000 dati1: .word 0xC000, 0xF000A000, 0x8000FFFF, 0x23150001, 0x0 .text main: sub1: move $t0, $zero la $t1,…
user7253265
0
votes
1 answer

MIPS: how can I apply the integer which users input into arithmetic function?

This is my first time coding PCSPIM. I find that there is a little trouble with my code. .data user_input: .asciiz "\n\nEnter an Integer for the value of n: " result_display: .asciiz "\nThe sum from 0 to n is " Greeting: .asciiz…
KoXing
  • 3
  • 2
0
votes
1 answer

MIPS: Aligning Output in Right Justified Columns

I am taking a class about how computers function on a lower level, mostly about memory management so far. Part of it is learning to write in Assembly Language using the PCSPIM simulator for MIPS processors. I just finished an assignment about…
Paul F.
  • 3
  • 3
0
votes
0 answers

How to convert decimal number to binary, octal and hexadecimal number in SPIM?

.data strIn: .asciiz "\nEnter a number:" reply: .asciiz "\nYour input is:" hexdigits: .asciiz "0123456789abcdef" hexword: .asciiz "00000000"` hexresult: .asciiz "\nHexadecimal code is:"` buffer: .space 10 .text .globl main main: #STEP 1 --…
0
votes
1 answer

MIPS ADDIU confusion

I am doing an assignment on single cycle MIPS processor and I am a little confused on the addiu instruction. On this website, as my reference the author states that the immediate will be sign extened Description: Adds a register and a…
Sugihara
  • 1,091
  • 2
  • 20
  • 35