dxforth <
dxf...@gmail.com> writes:
>On 18/05/2022 21:52, Zbig wrote:
>> So all this because 8080 has no command to do 16-bit transfer -- and sometime later
>> the translation of the code to x86 has been done „literally”, 1:1 -- no optimization at all?
>
>That's understandable considering few would have owned an 8086 at that time.
It's also not unusual: The story of how Microsoft ported Fortran-80
(and other products) to the 8086 is described in
<
https://retrocomputingforum.com/t/translation-of-8080-code-to-8086/1309>.
The author concludes that the result made a disappointing product, and
in comment #6 relates that MS then bought a license of a third-party
Fortran, certainly a winning strategy for MS.
Makes me wonder how much of a benefit the ability to translate 8080 to
8086 assembly code really was. It led to a lot of software early on,
such as Fortran-96 and fig-Forth, but could not transcend the 64K
boundary (but early-on few had more RAM), and eventually that software
was replaced with something specifically written for the 8086, such as
F83 or the external product in the Fortran case (that compiler was
written in Pascal).
I guess the benefit was that software was available earlier, but if
anybody hoped they could save on proper 8086 development, they were
disappointed, or their product was unlikely to survive.
The fig-Forth NEXT was not a 1:1 translation, though:
NEXT LDAX B LODSW ;(W) <- ((IP))
INX B ;LODSW ;(IP) <- (IP)+2
MOV L,A MOV BX,AX
LDAX B ;LODSW
INX B ;LODSW
MOV H,A ;MOV BX,AX ;(HL) <- CFA
NEXT1 MOV E,M ;JMP [BX] ;(PC) <- ((W))
INX H MOV DX,BX
INC DX
MOV D,M ;JMP [BX]
XCHG ;MOV DX,BX
PCHL JMP [BX] ;NOTE: (DE) <- CFA+1
A real 1:1 translation would have been much worse (you can find a
translation table in
<
http://www.s100computers.com/Software%20Folder/Assembler%20Collection/Digital%20Research%20XLT86%20Manual.pdf>).
The person who translated seems to have taken the register assignments
and contents at the basic block boundaries from the 8080, but produced
code that made locally good use of 8086 features.
Here's my go at a 1:1 translation according to the translation table:
NEXT LDAX B mov si, cx
mov al, [si]
INX B inc cx
MOV L,A mov bl, al
LDAX B mov si, cx
mov al, [si]
INX B inc cx
MOV H,A mov bh, al
NEXT1 MOV E,M mov dl, [bx]
INX H inc bx
MOV D,M mov dh, [bx]
XCHG xchg bx,dx
PCHL jmp bx
>Fig-Forth 8088/86 listing is dated MAR 1981. FIG had largely dropped support
>for Fig-Forth by then, opting instead to be involved in the Standards process.
>While FIG planned comprehensive revisions to several implementations, only
>the 8080 was completed AFAIK.
Support? Revisions? Are these compatible with the teachings of Chuck
Moore?