Go to https://www.cq.cx/ladder.pl, open source PLC for PIC and AVR, now maybe 8051 too -- look in the Forum. Couple of uploads which may work with Amtel 8051's. Like other members thoughts.
For https://www.cq.cx/ladder.pl described should not be used for serious purposes, while laderrwork seems much more serious program, if anyone knows how to use an external keyboard to set timers to let him ladderwork please describe.