Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

processor 8085 alp doubt

Status
Not open for further replies.

vasanth kumar

Junior Member level 1
Junior Member level 1
Joined
Jul 27, 2012
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Coimbatore
Visit site
Activity points
1,406
when I was trying to find answer for the following question, I got the answer 1022. please help me with your answers also.

find how many times the two JNZ are executed?

LXI H, 0503h
DCR L. : LOOP
JNZ LOOP
DCR H
JNZ LOOP
HLT
:roll:
 

The bottom JNZ is executed 80 times and the top JNZ is executed 240 times (3*80). I assume the LOOP labile is before the DCR L instruction not after it other wise the answer is infinite.
 

find how many times the two JNZ are executed?
Depends on what you understand as executed. There are 1022 jumps but the instructions are also executed several times without a jump.
 

You can download a JAVA application categorized as GNU General Public License version to perform this simulation :
Download website: https://sourceforge.net/projects/j8085sim/?source=pdlp

just out of curiosity, I run this code, and had to perform some adjusts at the one you gave above, but an error happens after simulation.
I´m not sure, but seems as value 0503h may be oversized to register magnitude, I guess.


Code ASM - [expand]
1
2
3
4
5
6
7
LXI H, 1283 ; decimal conversion for 0503 HEX
DCR L
LOOP:
JNZ LOOP
DCR H 
JNZ LOOP
HLT ;




+++
 

As already mentioned in post #2, the label must be placed before DCR L.

I´m not sure, but seems as value 0503h may be oversized to register magnitude, I guess.
Register pair HL is loaded with a 16-bit value.
 

Unfortunately, at downloaded application, could not find any box which could perform time accounting for the simulated program, just fixed according to post #2.

As already mentioned in post #2, the label must be placed before DCR L.
Register pair HL is loaded with a 16-bit value.

But, seems as instruction at line bellow performs a load at half of HL pair :


Code ASM - [expand]
1
LXI H, 1283 ; decimal conversion for 0503 HEX




+++
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top