8086 is source code compatible with 8080. Zilog Z80 extended Intel 8080 with:
- An enhanced instruction set including bit manipulation, block move, block I/O, and byte search instructions
- New IX and IY index registers with instructions for direct base+offset addressing
- A better interrupt system...[1]
Is it possible to translate Z80 asm into 8086, even with different register layout? There was a translator but it left some opcode untranslated and needed human intervention.
PS: What about 8085's extention to 8080? Can these features be adapted for Z80 or 8086?
| Intel 8008 Datapoint 2200 | Intel 8080 Intel 8085 | Zilog Z80 | Intel 8086 Intel 8088 |
|---|---|---|---|
| before ca. 1973 | ca. 1974 | 1976 | 1978 |
LBC | MOV B,C | LD B,C | MOV BL,CL |
| — | LDAX B | LD A,(BC) | MOV AL,[BX] |
LAM | MOV A,M | LD A,(HL) | MOV AL,[BP] |
LBM | MOV B,M | LD B,(HL) | MOV BL,[BP] |
| — | STAX D | LD (DE),A | MOV [DX],AL[x] |
LMA | MOV M,A | LD (HL),A | MOV [BP],AL |
LMC | MOV M,C | LD (HL),C | MOV [BP],CL |
LDI 56 | MVI D,56 | LD D,56 | MOV DL,56 |
LMI 56 | MVI M,56 | LD (HL),56 | MOV byte ptr [BP],56 |
| — | LDA 1234 | LD A,(1234) | MOV AL,[1234] |
| — | STA 1234 | LD (1234),A | MOV [1234],AL |
| — | — | LD B,(IX+56) | MOV BL,[SI+56] |
| — | — | LD (IX+56),C | MOV [SI+56],CL |
| — | — | LD (IY+56),78 | MOV byte ptr [DI+56],78 |
| — | LXI B,1234 | LD BC,1234 | MOV BX,1234 |
| — | LXI H,1234 | LD HL,1234 | MOV BP,1234 |
| — | SHLD 1234 | LD (1234),HL | MOV [1234],BP |
| — | LHLD 1234 | LD HL,(1234) | MOV BP,[1234] |
| — | — | LD BC,(1234) | MOV BX,[1234] |
| — | — | LD IX,(1234) | MOV SI,[1234] |
LD A,(BC)translate toMOV AL,[BX]you've got the problem that in the Z80 case the address would have been loaded into B and C, and in the 8086/8 case the address would have therefore been loaded into BL and CL, not BX