Sure, here's the tentative syntax (from the code comment). I randomly picked the M80x's just to be easy to remember/type during debug.
--Enable/disable all screw mapping. Does not clear tables.
-- if no S prints report
-- create a screw table for srcaxis with one row per destaxis
-- if no arguments it prints a summary report
M801 R"srcaxis" A"destaxes" Sstart Iinterval Ncount
-- set screw table entries
may be called multiple times (once per row) for shorter gcode lines
-- if no data (rows) it prints contents of table
-- each entry is an offset (delta) value
M802 R"srcaxis" Xf0:f1:f2:f3... Yf0:f1:f2...
-- run the screwmap selftest (ifdef'ed just for debug testing)
I considered condensing the Mcode but the
destaxes is a list of possible axes that are adjusted by the source axis. So, the M802 syntax can be very very long.
On my machine the X axis has 3 rows of 36 floats and the Y axis has 3 rows of 48 floats. So the M802 is a very long list of numbers. I'm not sure what the gcode limit is but this would be about 3000 characters.
I let the M802 to be called repeatedly to set rows individually for clarity.
postscript: I'm obviously not wedded to syntax. I'd just like the script file to be readable.
There are two sets of 'upgrades' possible to the functionality for later syntax thoughts. I don't use that functionality on the CNC.
This can support directional tables (which I don't use but some milling folks do) to support directional leadscrew wear. It can also support backlash as a 1 column directional screw map.
postscript 2: in practice this works well in a script. Create a table, fill the values, create a table, fill ... The only odd error checking is to ensure the table data list is <= the defined length and the result values are monotonic. It would be easy enough to have M801 do both tasks depending on parameters but the interdependencies are worse and I think it's less clear.