
BASIC INSTRUCTION SET
LOOPE (Loop While Equal) and LOOPZ (Loop While Zero) are physically the same instruction. These instructions
Example: LOOPE START_LOOP (or LOOPZ START_LOOP). Each time the program encounters this instruction, it decrements ex and tests ex and ZF. If the value in ex is
LOOPNE (Loop While Not Equal) and LOOPNZ (Loop While Not Zero) are physically the same instruction. These instructions
Example: LOOPNE START_LOOP (or LOOPNZ START_LOOP). Each time the program encounters this instruction, it decrements ex and tests ex and ZF. If the value of ex is
3.6.2.3 EXECUTING A LOOP OR REPEAT ZERO TIMES
JCXZ (Jump if CX Zero) branches to the label specified in the, instruction if it finds a value of zero in ex. Sometimes, it is desirable to design a loop that executes zero times if the count variable in ex is initialized to zero. Because the LOOP instructions (and repeat prefixes) decrement ex before they test it, a loop will execute 65,536 times if the program enters the loop with a zero value in ex. A programmer may conveniently overcome this problem with JeXZ, which enables the program to branch around the code within the loop if ex is zero when JeXZ executes.
Example: JeXZ TARGETLABEL. Causes the program to branch to the instruction labeled TARGETLABEL if ex=o when the instruction executes.
3.6.3 Software-Generated Interrupts
The INT n and INTO instructions allow the programmer to specify a transfer to an interrupt service routine from within a program. Interrupts
3.6.3.1 SOFTWARE INTERRUPT INSTRUCTION
INT n (Software Interrupt) activates the interrupt service routine that corresponds to the number coded within the instruction. Interrupt type 3 is reserved for internal
Example: INT 3. Transfers control to the interrupt service routine specified by a type 3 interrupt.