The definition of the function uses the ordering {mod, reg, rm}, which is correct. Match the prototype to this, so that the parameter list isn't misleading.