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

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 the BEQ instruction do exactly?

On Motorola 68k family, it stands for “branch if equal” which means “jump to given address if zero flag is set” such as when previous comparison is successful. However, 68332 seems to be different. Based on uppercase syntax, it could be a macro around another instruction which essentially does the same thing. Assembly programmers who … Read more