The move
instruction copies a value from one register to another. The li
instruction loads a specific numeric value into that register.
For the specific case of zero, you can use either the constant zero or the zero register to get that:
move $s0, $zero li $s0, 0
There’s no register that generates a value other than zero, though, so you’d have to use li
if you wanted some other number, like:
li $s0, 12345678
Related Posts:
- MIPS to C Translation
- Assembly x86 – “leave” Instruction
- How can one see content of stack with GDB?
- X86 assembly – Handling the IDIV instruction
- Why shift a bit using sll and such in MIPs Assembly?
- Understanding how `lw` and `sw` actually work in a MIPS program
- need help understanding the movzbl call in this function
- ARM Assembler – How do I use CMP, BLT and BGT?
- MIPS: lw (load word) instruction
- Converting a C program to MIPS
- MIPS assembly for a simple for loop
- what does .space do in mips?
- mips .word function and differences between 2 codes
- Display value found at given address gdb
- Why doesn’t there exists a subi opcode for MIPS?
- waitpid, wnohang, wuntraced. How do I use these
- Convert C program into assembly code
- How to initialize array to 0 in C?
- How to do scanf for single char in C
- Sign extend a nine-bit number in C
- Warning: assignment from incompatible pointer type
- Break statement not within loop or switch in C
- How to properly malloc for array of struct in C
- What exactly does the lb instruction do?
- Cache Simulator in C
- C: error: expected ‘)’ before ‘;’ token
- What is the difference between la and li in opcodes in MIPS?
- Where is the C auto keyword used?
- make: Nothing to be done for `all’
- Data argument not used by format strings in C
- execv vs execvp, why just one of them require the exact file’s path?
- difference between
and - expected expression before ‘{‘ token
- Bubble sort algorithm in MIPS
- Setting std=c99 flag in GCC
- C Vector/ArrayList/LinkedList
- Convert char array to a int number in C
- Bind failed: Address already in use
- Warning/error “function declaration isn’t a prototype”
- What is the difference between %f and %lf in C?
- Returning an array using C
- warning: initializer element is not computable at load time
- What is stdin in C language?
- How do I correctly use the mod operator in MIPS?
- How to prevent multiple definitions in C?
- How to pass 2D array (matrix) in a function in C?
- error: ‘for’ loop initial declarations are only allowed in C99 mode [duplicate]
- How can you print multiple variables inside a string using printf?
- c – warning: implicit declaration of function ‘printf’
- Flushing buffers in C
- What are 0x01 and 0x80 representative of in C bitwise operations?
- How to make parent wait for all child processes to finish?
- Undefined Reference issues using Semaphores
- What is time(NULL) in C?
- Use of cudamalloc(). Why the double pointer?
- C dynamically growing array
- Why should we check WIFEXITED after wait in order to kill child processes in Linux system call?
- what is the use of ori in this part of MIPS code?
- How to compile makefile using MinGW?
- Storing a user’s input in MIPS
- Mapping a numeric range onto another
- Why are hexadecimal numbers prefixed with 0x?
- Portable way to check if directory exists [Windows/Linux, C]
- OpenGL — GL_LINE_LOOP —
- too many arguments for format [-Wformat-extra-args]
- How to use EOF to run through a text file in C?
- Incorrect checksum for freed object on malloc
- Valgrind complains with “Invalid write of size 8”
- Expression must be a pointer to a complete object type using simple pointer arithmetic
- How to copy a char array in C?
- Simple way to check if a string contains another string in C?
- What does “request for member ‘*******’ in something not a structure or union” mean?
- cast to pointer from integer of different size, pthread code
- Invalid type argument of unary ‘*’ (have ‘int’) Error in C
- Segmentation fault (core dumped) due to fgets – I think
- Why do I get “cast from pointer to integer of different size” error?
- C subscripted value is neither array nor pointer nor vector when assigning an array element value
- What does “request for member ‘*******’ in something not a structure or union” mean?
- Unknown ending signal when using debugger gdb
- Valgrind: invalid read of size 4 -> sigsegv, works fine without valgrind and in visual studio
- error: too few arguments to function `printDay’ (C language)
- How to convert integer to char in C?
- Integer absolute value in MIPS?
- Is there a good Valgrind substitute for Windows?
- Difference between sizeof(char) and sizeof(char *)
- Where to find the complete definition of off_t type?
- xorl %eax – Instruction set architecture in IA-32
- MIPS Assembly – lui $t0, 4097?
- struct has no member named
- printf not printing to screen
- Greater than, less than equal, greater than equal in MIPS
- Initializing array of structures
- Still Reachable Leak detected by Valgrind
- How to empty a char array?
- MIPS program jr $ra instructions and stack handling
- What is the difference between array and enum in C ?
- Undefined reference to main – collect2: ld returned 1 exit status
- What is signed integer overflow?
- What does the term “empty loop” refer to exactly in C and C++?
- When to use const char * and when to use const char []