Where Am I Going Wrong with My 8085 Microprocessor Program?

  • Thread starter Thread starter erece
  • Start date Start date
Click For Summary
SUMMARY

The discussion focuses on debugging an 8085 microprocessor program intended to store and process ten positive current readings starting from memory location C200H. The user’s code contains several issues, including incorrect handling of the accumulator and improper memory addressing. Key operations include moving data to memory and performing arithmetic operations, but the program fails to correctly sum the readings due to logical errors in the flow control. The final output is intended to be stored at C300H, with an overflow indication at C301H.

PREREQUISITES
  • Understanding of 8085 assembly language syntax and instructions
  • Familiarity with memory addressing in 8085 microprocessor
  • Knowledge of arithmetic operations and conditional jumps in assembly programming
  • Experience with debugging techniques for low-level programming
NEXT STEPS
  • Review 8085 assembly language instruction set and their functionalities
  • Learn about memory management and data storage in the 8085 microprocessor
  • Practice debugging techniques specific to assembly language programs
  • Explore examples of arithmetic operations in 8085 assembly to understand common pitfalls
USEFUL FOR

Students and professionals working with the 8085 microprocessor, assembly language programmers, and anyone interested in low-level programming and debugging techniques.

erece
Messages
70
Reaction score
0
Write a program .. A set of ten current readings is stored in memory locations starting at C200H . The readings are expected to be positive (<127 base 10).
Please tell where i am wrong


MVI A,00H
JZ beg
neg : MOV A,D
JMP NXTBYT
beg: LXI H,C200H
MVI M,28H
INX H
MVI M,D8H
INX H
MVI M,C2H
INX H
MVI M,21H
INX H
MVI M,24H
INX H
MVI M,30H
INX H
MVI M,2FH
INX H
MVI M,19H
INX H
MVI M,F2H
INX H
MVI M,9FH
MVI B,FFH
MVI C,06H
LXI H,C200H
start: MOV D,A
MOV A,M
RAL
JC neg
RAR
MOV A,D
ADD M
CMP B
JC over
NXTBYT: INX H
DCR C
JNZ start
STA C300H
JMP end
over: MVI A,FFH
STA C301H
end: HLT
 
Engineering news on Phys.org
Welcome to PhysicsForums!

Can you tell us more about the numbers you're expected to add? The following came up in a search for '8085 assembly language' when I was looking for what the operands meant (my own learning was on Microchip PIC and Motorola 68000 assembler), and it may prove useful to you:
http://www.go4expert.com/forums/showthread.php?t=302

In situations like this, I find it helpful to go through code and then make comments as to what the code does: this allows you to examine the flow of the code and ensure that it's doing what you want it to be doing.
 
28 , d8 , c2 , 21 , 24 , 30 , 2f , 19 , f2 , 9f
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K