Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Conditional Instructions JZ and JNZ

Status
Not open for further replies.

jones86

Newbie level 2
Joined
Jan 14, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,292
jz jnz

These both instructions JZ and JNZ are not working for me. ie for JZ(Jump on Zero) though the accumulator is not zero, i am getting the jump instruction executed.

Pls help my explaining in small programs
 

nandhu015

Advanced Member level 5
Joined
Feb 11, 2006
Messages
1,965
Helped
300
Reputation
600
Reaction score
224
Trophy points
1,353
Location
India
Activity points
9,815
jz y jnz instrucciones

Please give more details, what software are you using and what microcontroller etc.

Nandhu
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,593
Helped
4,783
Reputation
9,583
Reaction score
4,565
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
124,372
condicional instructions

Those instructions usually check the zero flag in a status register, not the contents of the accumulator.

As Nandhu says, we need more information. A section of code showing the problem would help.

Brian.
 

ark5230

Advanced Member level 3
Joined
Jun 29, 2009
Messages
858
Helped
163
Reputation
324
Reaction score
140
Trophy points
1,323
Location
India
Activity points
6,143
jz to jnz

Please post the microcontroller type used and the portion of code (JZ, JNZ) is giving trouble.
 

Somphorn

Member level 1
Joined
Sep 4, 2009
Messages
35
Helped
1
Reputation
2
Reaction score
0
Trophy points
6
Location
Johore, Malaysia
Activity points
0
jnz $-20

betwixt is correct. jz and jnz will check to see the ZERO flag, not the accumulator. This condition is true for any microprocessor, I believe. Basically, something is done in previous two or three instructions before JZ and after that you test the zero flag. You might wanna read more on how the zero flag is affected by other instructions.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top