The code is basically a series of numbers, which when combined with each move of the Lian Cheng Jian Fa (aka Tang Poem Jian Fa), will reveal the location of the treasure.
For example, if the first number was 4, and the first move of the Jian Fa is based on the Poem XYZ, then you can go to the Collection of Tang Poem book, look up Poem XYZ, and see what the 4th word of the poem is, and that word is the first word of the answer.
You could find the answer using any regular TP book, but you needed to know the code. What made THE TP book (the one that Qi Chang Fa stole) special is that the code is already in the book, written in invisible ink and revealed when wet. Anyway, if you've seen the Mainland version, you know already. I saw the HK version when I was very young, but I don't remember much of anything. I hear many revisions were made though.