I am currently learning to program in the 8085 microprocessor. Take a look at the program below:
LXI H, 2050
MOV B, M
INX H
MOV C, M
MVI A 00H
TOP: ADD B
DCR C
JNZ TOP
INX H
MOV M, A
HLT
This program multiplies two 8-bit numbers in the 8085 microprocessor. what is the opcode for statements with labels in general?
There is no opcode for a label itself. The assembler translates labels into addresses when you reference them from other places.
TOP: ADD B
will be translated simply to 80
, just as if the label wasn't there. The label address is the address where the 80
goes, the current position in the output for that line.
If, for example, this location is at address 1000H, JNZ TOP
translates to C2 00 10
.