What are .S files?

.S files are source code files written in assembly. Assembly is an extremely low-level form of programming. The files contain assembly instructions to the processor in sequential order and are typically compiled based on a selected architecture. Examples of such files are often seen in the linux kernel for specific architectures, e.g. x86, sparc, ARM, … Read more

Bubble sort algorithm in MIPS

I’m trying to write a procedure in assembly that sorts an array using bubble-sort algorithm but I’m having a problem which is: In line 22, when the first iteration executed nothing is wrong, program loads array[i+1] perfectly into registrar $a1 and if the swap condition is valid, program swaps without any problem. However, in the … Read more

What does movslq do?

It’s movsxd: https://www.felixcloutier.com/x86/MOVSX:MOVSXD.html. You could figure this out yourself by assembling it with an AT&T assembler and disassembling with an Intel-syntax disassembler. (e.g. objdumpd -d -Mintel foo.o) And yes, it does 32->64-bit 2’s complement sign extension, extending by copying the sign-bit of the source to all the new upper bits. (i.e. dst[63:32] = src[31], and dst[31:0] = src[31:0].) Fun fact: it’s … Read more

movq assembly function

movq (assuming you’re talking about x86) is a move of a quadword (64-bit value). This particular instruction: looks very much like code that will walk up through stack frames. This particular instruction grabs the quadword pointed to by the current stack pointer, and loads it into the stack pointer, overwriting it. By way of example, this … Read more

What is the difference between la and li in opcodes in MIPS?

They’re fairly similar, as both are (mostly) used for loading immediate values. Both of them are also pseudo-instructions, so it’s really up to each assembler that supports them to determine exactly how they should function. li stands for Load Immediate and is a convenient way of loading an immediate up to 32 bits in size. Instructions like addi and ori can … Read more

What exactly does the lb instruction do?

The answer would be c) 0xffffff88. The lb instructions sign-extends the byte into a 32-bit value. I.e. the most significant bit (msb) is copied into the upper 24 bits. 0x88 == 0b10001000, i.e. the msb is 1. So the upper 24 bits will be 0b111111111111111111111111 == 0xffffff.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)