addiu instruction encoding (MIPS,GCC)
NickName:David Ask DateTime:2017-08-29T22:22:21

addiu instruction encoding (MIPS,GCC)

Here is addiu instruction opcode (16-bit instructions, GCC option -mmicromips):

 full instruction: addiu sp,sp,-280
 opcode, hexa:     4F75         
 opcode, binary:   1001(instruction) 11101(sp is $29) 110101

My purpose is to detect all instruction of this kind (addiu sp,sp,) and then to decode the immediate, in the above case (-280) (to follow the sp). What I don't understand is the encoding of (-280). Linked to: How to get a call stack backtrace?(GCC,MIPS,no frame pointer)

Copyright Notice:Content Author:「David」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/45941568/addiu-instruction-encoding-mips-gcc

More about “addiu instruction encoding (MIPS,GCC)” related questions

addiu instruction encoding (MIPS,GCC)

Here is addiu instruction opcode (16-bit instructions, GCC option -mmicromips): full instruction: addiu sp,sp,-280 opcode, hexa: 4F75 opcode, binary: 1001(instruction) 11101(sp i...

Show Detail

MIPS Instruction ADDIU

How can I identify what is the corresponding C code written for instruction in MIPS, ADDIU sp sp 0xFFE0? Using MPLAB IDE I can find out this address but am unable to find out, how does it work?

Show Detail

Expanding or avoiding addiu in MIPS

I've implemented a program (a fully-connected layer) in C, which needs to be compiled to MIPS to run on a specific microprocessor in order to test the microprocessor's function. Since the ADDIU

Show Detail

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 exte...

Show Detail

MIPS Instruction Decoding

I'm trying to understand how to decode MIPS binary instructions. I compiled a hello world program in C on a Debian MIPS system with gcc and objdump shows me that the first instruction in the .text

Show Detail

How to let GCC for MIPS restore the stack pointer just before returning?

When GCC for MIPS compiles a leaf function, it generates assembly code like the following: addiu $sp, $sp, 72 sb $v1, 0($v0) lbu $a0, 5($t2) lw $v0, 0($t1) sb $a0,1($v0) ...

Show Detail

MIPS Cross Compiler Invalid instruction

I would like to generate MIPS binaries using gcc in Centos7. I've successfully install binutils and gcc. Command line I used for cross-compilation: mips-mti-elf-gcc -o exception.o exception.c Th...

Show Detail

MIPS, ADDIU out of range in PCSPIM

I have the follow instruction, and I don't understand why the PCSPIM is giving me the following warning: spim:(parser) immediate value (61440) out of rainge (-32768..32767) on line 88 of file a...

Show Detail

MIPS stack frame (and "addiu" instruction confusion)

I'm new to MIPS and am trying to understand the disassembly of a function. (EDIT: it is dynamically linked to /lib/ld-uClib.so.0 and uses some usual libc functions, so I assume it was written in C ...

Show Detail

gcc mips signed arithmetic on bytes

I have fed this simple code to gcc volatile signed char x, y, z; void test() { x = 0x31; y = x + 3; } Volatile has been added just to avoid gcc optimization (set to -O0 anyway). Resu...

Show Detail