Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

JCXZ in Assembly language:

JCXZ (jump if cx=0)
Simple Program that show the use of Jcxz.

.model small
.data
msg db"counter is zero$"
msg1 db"not zero$"
.code
mov ax,@data
mov ds,ax
mov cx,0
jcxz A                 //if cx=0 then jump to label A and then B and program exit
mov ah,09h          //if cx!=0 then print msg1 then jump to label b and exit
mov dx,offset msg1
int 21h
jmp B
A:
mov ah,09h
mov dx,offset msg
int 21h
B:
.exit
end

OUTPUT:





This post first appeared on AR Programming, please read the originial post: here

Share the post

JCXZ in Assembly language:

×

Subscribe to Ar Programming

Get updates delivered right to your inbox!

Thank you for your subscription

×