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

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’s the size of a QWORD on a 64-bit machine?

In x86 terminology/documentation, a “word” is 16 bits because x86 evolved out of 16-bit 8086. Changing the meaning of the term as extensions were added would have just been confusing, because Intel still had to document 16-bit mode and everything, and instruction mnemonics like cwd (sign-extend word to dword) bake the terminology into the ISA. x86 word = … 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