I just downloaded Turbo Pascal 3.0 for CP/M awhile ago to see if it would be usable for a Z80 project I'm working on. If ByteVar is a byte variable, depending upon whether the value in HL is needed, optimal code for "ByteVar:=ByteVar+1;" is either:
orLD HL,ByteVar INC (HL)
Unfortunately, Turbo Pascal isn't quite so efficient:LD A,(ByteVar) INC A LD (ByteVar),A
I think I'll try looking at Turbo Pascal 3.0 for PC's code and see how that is. Many applications were developed on that platform, including the original Tetris.LD HL,(ByteVar) LD H,0 PUSH HL LD HL,1 POP DE ADD HL,DE LD A,L LD (ByteVar),A