what is a file handle and where it is useful for a programmer?

There is a generic concept generally called a “handle” in the context of computer software APIs. In the comments you have probably found a link to the Wikipedia article on that subject. You are dealing with a specific implementation of a handle data type — the IBM PC/DOS file handles returned from the int 0x21 interface. If you … Read more

Difference between JE/JNE and JZ/JNZ

JE and JZ are just different names for exactly the same thing: a conditional jump when ZF (the “zero” flag) is equal to 1. (Similarly, JNE and JNZ are just different names for a conditional jump when ZF is equal to 0.) You could use them interchangeably, but you should use them depending on what you are doing: JZ/JNZ are more appropriate when you are explicitly testing for something being equal … Read more

sorting array in mips (assembly)

This link explains how to print to the screen in a MIPS simulator like QTSPIM or MARS. As for the code, there were a few bugs. The line li $a0, 0 is overwriting the work done by the initial la $a0, Array instruction because the li is setting the base address of your array to 0. Instead, you should move the la instruction into the loop so … Read more

Difference between “addi” and “add” for pseudoinstruction “move” in MIPS?

The addi instruction requires an immediate operand rather than a register, so the $0 would actually be 0: Both will work and have all the needed information encoded into the instruction itself): However, it would be more usual to just use the zero-locked $0 register in this particular case since that is, after all, its purpose. I would also tend to use the unsigned variant however, since I … Read more