Where Am I Going Wrong with My 8085 Microprocessor Program?

  • Thread starter erece
  • Start date
In summary: C200H. The program begins by loading the value 00H into the accumulator A and checking if it is zero. If not, the program jumps to the label "beg". Otherwise, it proceeds to load the hexadecimal values into the memory addresses starting at C200H. Then, it sets the values of B and C to FFH and 06H respectively. Next, it loads the value of A into the data register D and checks if the value in A is negative. If so, it jumps to the label "neg". Otherwise, it adds the value in A to the memory location pointed by the HL register pair and compares it to the value in B. If the
  • #1
erece
72
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
  • #2
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.
 
  • #3
28 , d8 , c2 , 21 , 24 , 30 , 2f , 19 , f2 , 9f
 

1. What is an 8085 microprocessor?

The 8085 microprocessor is an 8-bit microprocessor that was first introduced by Intel in 1976. It is a popular microprocessor used in many electronic devices, including computers, calculators, and industrial control systems.

2. What are the main features of the 8085 microprocessor?

The main features of the 8085 microprocessor include an 8-bit data bus, a 16-bit address bus, a maximum clock speed of 3 MHz, and a total of 246 instructions. It also has a built-in serial I/O port, 16-bit stack pointer, and various interrupt handling capabilities.

3. What is the difference between the 8085 and 8086 microprocessors?

The main difference between the 8085 and 8086 microprocessors is the data bus width. The 8085 has an 8-bit data bus while the 8086 has a 16-bit data bus. This means that the 8086 can process data faster and handle larger amounts of data than the 8085.

4. What is the instruction set of the 8085 microprocessor?

The 8085 microprocessor has a total of 246 instructions, including arithmetic, logical, and data transfer operations. It also has special instructions for I/O operations and interrupt handling.

5. What are the applications of the 8085 microprocessor?

The 8085 microprocessor is used in a wide range of applications, including industrial control systems, embedded systems, electronic toys, and home appliances. It is also used in some older computer systems and as a teaching tool for learning about microprocessors and assembly language programming.

Back
Top