I have 8085 assembly code for dividing 2 data 8 bit
:
MVI C,FFH
LXI H,1900H
MOV A,M (A=08)
INX H
MOV B,M (B=3)
REPEAT: INR C
SUB B
JNC REPEAT
ADD B
INX H
MOV M,C
INX H
MOV M,A
HLT
If you don't use the special opcodes
RIM
andSIM
that only the 8085 has, the resulting machine code will run in almost all cases on the Z80 without changes. This is the case with your program.However, if your task is to translate the mnemonics, just do a search-and-replace session. Start with the first one,
MVI
, and change it toLD
. And so on.You will need to change operands like
M
to(HL)
, too, because that is the syntax of the Z80 assembler.Anyway, you need both instruction sets to do this.