Convert C program into assembly code

How exactly do I convert this C program into assembly code? I am having a hard time understanding this process or how to even start it. I am new to this. Any help would be appreciated! Side Note: Assume two positive integers a and b are already given in register R0 and R1.Can you leave … Read more

IDIV operation in assembly (understanding)

when I have the the operation in assembly, then i have read that the that the value in edx:eax is divided by the operand ecx. I also know that the quotient is stored in eax and the remainder in edx. so but what exactly is the value in edx:eax ?? Can someone explain it to … Read more

Purpose of ESI & EDI registers?

There are a few operations you can only do with DI/SI (or their extended counterparts, if you didn’t learn ASM in 1985). Among these are Which are, respectively, operations for repeated (= mass) storing, loading and scanning. What you do is you set up SI and/or DI to point at one or both operands, perhaps put a … Read more

Why doesn’t there exists a subi opcode for MIPS?

When you create an instruction set, you’re bound by some constraints, such as the total number of instructions you can create. The MIPS creators realized that there isn’t a need for subi (because you can add a negative number with addi using 2’s complement), and they simply made the decision to forego making that instruction. It may have been … Read more

Display value found at given address gdb

You are correctly reading the value at memory address 0x8048f0b, but the line call 8048f0b <strings_not_equal> indicates that this address is the start of a function (called strings_not_equal()). You wouldn’t expect that to be ASCII – you’d expect it to be more machine code. If you’re looking for the function arguments to strings_not_equal(), those are being pushed onto the stack. … Read more

mips .word function and differences between 2 codes

On MIPS, the size of a pointer to your data is .word, usually 32 bits. Furthermore, MIPS requires that your data is aligned to certain addresses depending on the type (i.e. size) of the data itself. First let’s look at the pointers and data that you declare in your program’s .data section: msg and msg_data can be considered labels or symbolic names for your data, and you … Read more

what does .space do in mips?

.space Len directive instructs the assembler to reserve Len bytes. As every word has 4 bytes, when Len is 20 you are instructing the assembler to reserve 5 words. For example if you have then other_data will be 20 bytes after array address. Due to architectural constraints in MIPS you may need to also instruct the assembler to align the … Read more

Difference between JA and JG in assembly

As Intel’s manual explains, JG interprets the flags as though the comparison was signed, and JA interprets the flags as though the comparison was unsigned (of course if the operation that set the flags was not a comparison or subtraction, that may not make sense). So yes, they’re different. To be precise, ja jumps if CF = 0 and ZF … Read more

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