In the traditional standard, numbers for those entities start with a digit, followed by a number of 4 digits in the range 1–9,999:
coils numbers start with 0 and span from 00001 to 09999,
discrete input numbers start with 1 and span from 10001 to 19999,
input register numbers start with 3 and span from 30001 to 39999,
holding register numbers start with 4 and span from 40001 to 49999.
This translates into addresses between 0 and 9,998 in data frames. For example, in order to read holding registers starting at number 40001, corresponding address in the data frame will be 0 with a function code of 3 (as seen above). For holding registers starting at number 40100, address will be 99. Etc.
This limits the number of addresses to 9,999 for each entity. A de facto referencing extends this to the maximum of 65,536. It simply consists of adding one digit to the previous list:
coil numbers span from 000001 to 065536,
discrete input numbers span from 100001 to 165536,
input register numbers span from 300001 to 365536,
holding register numbers span from 400001 to 465536.
source : https://en.wikipedia.org/wiki/Modbus#Coil,_discrete_input,_input_register,_holding_register_numbers_and_addresses
EDIT : To make it clear, if a holding register address is told being 0001, then read it as read code 4 then address 1. But if it's told to be 40001, use read code 4 but address may vary depending the constructor (1 or 40001).