Condition: jumps if CX = 0. Unlike the other conditional jumps it reads no flag at all: it looks straight at CX, without changing CX or the flags. There is no opposite "JCXNZ".
Its job is to protect a loop. LOOP decrements CX before testing it, so a loop entered with CX = 0 wraps CX to FFFFh and runs 65536 times. When the count comes from data, put JCXZ in front:
MOV CX, [COUNT1] ; how many stars (0 here)JCXZ NONE1 ; skip the loop entirelySTAR1:MOV DL, "*"MOV AH, 02h ; DOS: print the character in DLINT 21hLOOP STAR1NONE1:MOV DL, "."MOV AH, 02h ; DOS: print the character in DLINT 21hCOUNT1 DW 0
Range
JCXZ (opcode E3h) is SHORT only, −128..+127 bytes, and MASM cannot lengthen it the way it lengthens JE. For a far target use JCXZ as a short hop to a nearby JMP, or write TEST CX, CX / JZ, which MASM can extend. Before a REP string instruction no guard is needed: REP with CX = 0 does nothing.
Later CPUs
The 386 adds JECXZ, the same opcode testing ECX in 32-bit code. It stayed short-range only.