Since this is for a lathe, there are only 2 joints in the HAL parameters. LinuxCNC requires that the joints are numbered from 0 consecutively, that is, I can only have joints 0 and 1. The association between joint 1 and the z axis is done in the HAL files. With that association, GCode works properly.
As I mentioned before, the pendant was jogging the X axis as I wanted in Step, Velocity and Continuous mode before I moved to the mesa card. I was using exactly the same vc-p1as.hal file as the one I'm trying to use now. Something very subtle changed and that's what I'm trying to figure out.
I tried debugging with halmeter and see what signals were triggered when I used the pendant, but that didn't help much. I'm still learning about the HAL.
Thanks once again for looking into this issue.