Where Am I Going Wrong with My 8085 Microprocessor Program?

  • Thread starter Thread starter erece
  • Start date Start date
Click For Summary
The discussion centers on troubleshooting an 8085 microprocessor program designed to store and process ten positive current readings from memory locations starting at C200H. The program contains several instructions, including loading values into registers and performing arithmetic operations, but the user is unsure where the logic may be failing. Suggestions include reviewing the flow of the code and adding comments to clarify each step, which can help identify errors. There is also a request for clarification on the specific numbers being processed. Overall, the conversation emphasizes the importance of understanding code flow and the expected data to resolve programming issues.
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
 
I am trying to understand how transferring electric from the powerplant to my house is more effective using high voltage. The suggested explanation that the current is equal to the power supply divided by the voltage, and hence higher voltage leads to lower current and as a result to a lower power loss on the conductives is very confusing me. I know that the current is determined by the voltage and the resistance, and not by a power capability - which defines a limit to the allowable...

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K