Here are some Pascal programms I have written years ago, maybe you can use them.
Some are Turbo-Pascal (so the charset is not latin1 !), others are VAX-Pascal.