A few days ago
Need help with 8085 µP ALP …?
I have to count the number of odd as well as even bytes occuring in a block of data (say from 3001H to 3005H) length of block is at 3000H. have to store the result at 300AH and 300BH respectively …
I have tried this but there is something wrong and its not working right .. :
LXI H,3000H
MOV C,M
MVI B,00H
MVI D,00H
label1:INX H
MOV A,M
RRC
JNC label
INR D
DCR C
JNZ label1
label:INR B
DCR C
JNZ label1
LXI H,300AH
MOV M,D
INX H
MOV M,B
HLT
Top 1 Answers
A few days ago
Favorite Answer
The problem seems to be in this block:
RRC
JNC label
INR D
DCR C
JNZ label1
*******
If the last intended byte resulted in a D increment and C decrement, the code flows through, increments B as well, decrements C again which goes negative and does the JNZ back to label1 because C is no longer zero.
You need a JMP to the LXI statement here
*******
label:INR B
DCR C
JNZ label1
LXI H,300AH
0
- Academic Writing
- Accounting
- Anthropology
- Article
- Blog
- Business
- Career
- Case Study
- Critical Thinking
- Culture
- Dissertation
- Education
- Education Questions
- Essay Tips
- Essay Writing
- Finance
- Free Essay Samples
- Free Essay Templates
- Free Essay Topics
- Health
- History
- Human Resources
- Law
- Literature
- Management
- Marketing
- Nursing
- other
- Politics
- Problem Solving
- Psychology
- Report
- Research Paper
- Review Writing
- Social Issues
- Speech Writing
- Term Paper
- Thesis Writing
- Writing Styles