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
- need help understanding the movzbl call in this function
- what does .space do in mips?
- mips .word function and differences between 2 codes
- Why doesn’t there exists a subi opcode for MIPS?
- waitpid, wnohang, wuntraced. How do I use these
- Convert C program into assembly code
- Warning: assignment from incompatible pointer type
- What exactly does the lb instruction do?
- C: error: expected ‘)’ before ‘;’ token
- Where is the C auto keyword used?
- 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 - Warning/error “function declaration isn’t a prototype”
- Returning an array using C
- warning: initializer element is not computable at load time
- How to prevent multiple definitions in C?
- How can you print multiple variables inside a string using 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?
- Mapping a numeric range onto another
- Why are hexadecimal numbers prefixed with 0x?
- OpenGL — GL_LINE_LOOP —
- How to use EOF to run through a text file in C?
- Valgrind complains with “Invalid write of size 8”
- Expression must be a pointer to a complete object type using simple pointer arithmetic
- What does “request for member ‘*******’ in something not a structure or union” mean?
- 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)
- Is there a good Valgrind substitute for Windows?
- Difference between sizeof(char) and sizeof(char *)
- xorl %eax – Instruction set architecture in IA-32
- MIPS Assembly – lui $t0, 4097?
- printf not printing to screen
- How to empty a char array?
- Undefined reference to main – collect2: ld returned 1 exit status
- Is there a way to have printf() properly print out an array (of floats, say)?
- Convert Little Endian to Big Endian
- How do you allow spaces to be entered using scanf?
- Excess elements of scalar initializer for pointer to array of ints
- How does one represent the empty char?
- Assembly language (MIPS) difference betweent addi and add
- How to write to a file using open() and printf()?
- MIPS Address out of range (MARS)
- Can I define a function inside a C structure?
- Where is the
header file on Linux? Why can’t I find ? - How do I compile the asm generated by GCC?
- What is the difference between %g and %f in C?
- Why is the sizeof(int) == sizeof(long)?
- Structure padding and packing
- sorting array in mips (assembly)
- Multiplication by a power of 2 using Logical shifts in MIPS assembly
- Tokenizing strings in C
- How to allocate array of pointers for strings by malloc in C?
- Convert from Java to MIPS
- Understanding Assembly MIPS .ALIGN and Memory Addressing
- How to format strings using printf() to get equal length in the output
- “-bash: gcc: command not found” using cygwin when compiling c?
- In C, what exactly happens when you pass a NULL pointer to strcmp()?
- lseek/write suddenly returns -1 with errno = 9 (Bad file descriptor)
- Should I use printf(“\n”) or putchar(‘\n’) to print a newline in C?
- What do \t and \b do?
- Why and when to use static structures in C programming?
- error: struct has no member named X
- Where does linux store my syslog?
- Constructor for structs in C
- write() to stdout and printf output not interleaved?
- Split string with multiple delimiters using strtok in C
- warning: missing terminating ” character [enabled by default]
- How to free memory from char array in C
- FFT in a single C-file
- Implicit function declarations in C
- Convert long long to string in C?
- How do I check if a string contains a certain character?
- Using pointer to char array, values in that array can be accessed?
- How can I create a dynamically sized array of structs?
- malloc(sizeof(int)) vs malloc(sizeof(int *)) vs (int *)malloc(sizeof(int))
- GDB no such file or directory
- how to stop a loop arduino
- How to normalize a mantissa
- Level vs Edge Trigger Network Event Mechanisms
- How to use shared memory with Linux in C
- When is it ok to use a global variable in C?