Cher Emmanuel
> Ahem! As far as I remember (I have white hair), you should be talking of something named "the PL/M compiler", where PL/M is standing for "Programming Language for Microcomputers". And this PL/M Compiler used PLM source code files...
There is no such thing as "The PL/M Compiler" because, as pointed out there are many varieties.
>
> It is written in FORTRAN-IV, also know (to some Old Timers like me) as FORTRAN-66. (1966, not 2066...)
Indeed. I programmed in FORTRAN IV for 9 years!
>
> 3) This is funny, I was thinking that PL/M used LIT declarations as macros?
LIT declarations allow simple text substitution. In real applications you need MACROs with parameters. For example:-
/* The intrinsic Intel PL/M-80 MOVE can be optimized on Z80 */
#if defined(Z80)
# define MOVE(len, src, dst) LDIRX(src, len, dst)
#endif
> Ha? Interesting! Could you precise the size? If I remember well, the >idea of the author of this compiler was to produce relocatable modules >that would be extracted from a library, not full programs. Too bad that >I did not manage to find its author.
Whatever purpose the author may have had, I don't think I could get any of the CP/M PL/M sources to compile. However very small programs, say 20 lines, may work.
>
> Of course, the source code of PL/M is available, so maybe it would be possible to disassemble PLMX, ...
In that case you may want to use my DTAB utility which AUTOMATICALLY analyzes a CP/M binary and generates RESOURCE compatible DOC, SYM, and CTL files.
>
>
>
>
> > PLM is not such a powerful language as C. Nevertheless the generated code is often much more efficient because C does not compile very well onto an architecture which lacks 16 bit indexed addressing (for local variables and function arguments).
>
> Yes, when I was young (remember Kernighan & Ritchie ?), I read countless articles explaining how awful the code generated by C compilers were, especially on the Z-80. It is amazing (but logical) to see how tied to a given hardware some system languages (like C) are. But, of course, the Newbies knowing only C cannot understand this, since they have no experience.
C is an excellent language but it simply isn't suitable for some kinds of hardware - like old 8 bit CPUs. There are 2 main problems. Firstly C expressions get promoted to word/pointer size, which is 16 bits on the 8080. Obviously this is not very efficient. Secondly, as I mentioned, local variables are dynamically allocated on a stack, but there are no instructions giving word size support for such access. Suppose you want to pass the address of a local buffer to a C routine on the Z80. The smallest code (8 bytes) you can do is:-
PUSH IX ; Base pointer
POP HL
LD BC,buffer
ADD HL,BC ; HL := IX + buffer
PUSH HL
In contrast the more modern EZ80 would allow:-
PEA (IX+buffer)