Using PC SPIM and converting hex and binary

  • Thread starter Thread starter TBonety
  • Start date Start date
  • Tags Tags
    Binary pc
Click For Summary
SUMMARY

The discussion centers on converting MIPS instructions into hexadecimal and binary formats using PCSpim, now known as QtSpim. The user specifically seeks assistance with the 'addi' instruction, represented in machine code as 0x214a0001, with the corresponding address being 0x0040004c. The conversation clarifies that the first number is the machine code for the 'addi' instruction, while the second indicates its location in the code segment. This exchange highlights the importance of understanding instruction encoding in MIPS programming.

PREREQUISITES
  • Familiarity with MIPS assembly language
  • Understanding of instruction encoding and machine code
  • Knowledge of PCSpim/QtSpim interface
  • Basic concepts of binary and hexadecimal number systems
NEXT STEPS
  • Learn how to convert MIPS assembly instructions to machine code
  • Explore the QtSpim user manual for advanced features
  • Study MIPS instruction formats and their binary representations
  • Practice using QtSpim to simulate MIPS programs and analyze outputs
USEFUL FOR

Students learning MIPS assembly language, software developers working with embedded systems, and anyone interested in low-level programming and machine code conversion.

TBonety
Messages
1
Reaction score
0
Hi there, new to the forums, but in need of assistance. I have been looking around and have found some helpful stuff on this site. I found myself visiting this site more then once, so i decided to make an account. Anyways my problem is I have to choose any two mips instructions from this code i wrote and convert them into hex and binary. My problem is I am kinda stuck.
I have chosen to do for one of my lines a simple addi function. It is:

addi $t2,$t2,1: to simply add one to my value stored in $t2.

in my pcspim i have some values and am unclear as what they do and how i should approach starting this.

0x214a0001

0x0040004c

My apologies if this is a very "newb" question but if i could just get a pointer on how to start this i would very much appreciate it.
 
Computer science news on Phys.org
Not a bad question. The first number, 0x214a0001, is the machine code for the addi (add immediate) instruction.
The second number is the address in the code segment for that instruction.

BTW, PCSpim is now called QtSpim.
 
Last edited:

Similar threads

Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
15K
  • · Replies 11 ·
Replies
11
Views
4K
Replies
1
Views
6K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
13
Views
39K
Replies
13
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 16 ·
Replies
16
Views
11K
  • · Replies 2 ·
Replies
2
Views
7K