MIcroprocessor about source code ;comment

Thread Starter

longcrystal

Joined Mar 22, 2010
20
sorry for disturb May i ask about this sourc

Identify the type of jump, the type of operand and operation performed by each of the instruction that follows

JNC 10 ; ??????

JNP PARITY_ERROR ; ??????

J0 DWORD PTR [BX] ; ??????


thk for help ~~and grateful
 

Papabravo

Joined Feb 24, 2006
21,227
sorry for disturb May i ask about this sourc

Identify the type of jump, the type of operand and operation performed by each of the instruction that follows

JNC 10 ; ??????

JNP PARITY_ERROR ; ??????

J0 DWORD PTR [BX] ; ??????


thk for help ~~and grateful
Each of the conditional jumps refers to one or more bits in a "condition code" register. These bits are set or cleared after instructions that use the processors ALU (Arithmetic Logic Unit). You did not specify which processor you were referring to but I'll try to help anyway. BTW the operands of these conditional jumps are all destination addresses in the code space relative to the CS register. They may or may not be relative to the current PC, it is hard to tell without looking at the assembler output.

JNC - Jump if no carry. This instruction tests the carry bit from the last arithmetic instruction. The jump is taken if there was no carry, and executes the next instruction if there was.

JNP - Jump if no parity. This instruction tests the parity bit. You need to consult the datasheet for your processor to see how the parity bit is computed. If it is the exclusive or of all the bits in the last result then it is referred to as an "odd parity bit". If it is the exclusive NOR then it is an even parity bit. The jump is taken if the parity bit is zero, and the next instruction is executed if the parity bit is one.

JO - Jump if overflow. The operand DWORD PTR [BX] suggests that the processor you are working with is an 8086 or derivative. The overflow bit is set when working with signed operands and the sign of the result is different than the signs of the operands. I'm not absolutely sure of this, but I don't think overflow is possible with one positive and one negative operand. In any case the jump will be taken if there is overflow, and the next instruction will be executed otherwise. The destination is contained in the [CS:BX]. The DWORD PTR is a note to the assembler that the contents of [CS:BX] is aligned on a double word boundary.

http://home.comcast.net/~fbui/intel_j.html#jxx
 
Last edited:

Thread Starter

longcrystal

Joined Mar 22, 2010
20
ya thankq very much papabravo sorry i forget mention which microprocessor i use.

actually is 8086 ~~~

ok well ~~~ thk for u good explanation and helping me ~~~~thank a lot
 
Top