Where Am I Going Wrong with My 8085 Microprocessor Program?

  • Thread starter Thread starter erece
  • Start date Start date
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 3K views
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