As a very first try to de-compile a program I used the game of Quatris.
This game was compiled by TURBO PASCAL 3.x as a .COM file.
TURBO PASCAL links the entire Run Time Library into every created .COM file.
Therefore the addresses of the Run Time Routines are same for every compiled program.
This simplifies de-compilation.
The main job was to find the control instructions
(IF ...THEN ...ELSE , FOR ...TO , FOR ...DOWNTO , REPEAT ...UNTIL , WHILE ...DO , CASE )
within the disassembled source.
In preparation for the game find the original documentation here. And the result will be found here: QUATRIS.PAS. Hint: the speed will be controlled by an internal variable called SysClock". Therefore the program will run only with CP/M-80 if no modification is made. Of course an optimal program does never exist so I made a real mess of rewriting it. The internal variable SysClock" is bypassed, the messages are translated to German (made worse for English users), and the keyboard is adjusted for the JOYCE. Furthermore multiple names of players are filtered and the score is sorted - find the resulting QUATRISJ.PAS here |