The 44780, Hitachi (now Renesas) controller is the industry standard controller.
From this writeup -
It might be possible to modify the library such that whenever a write to display occurs
you save the address used by the write instruction to the display. That way you would
be able to keep track of it as Klaus states.
Another method is to create a buffer in ram of the display. And whenever you write to display
you check if buffer has the data, character for character. If not you update display and buffer,'
only the characters that have changed. If buffer already does have desired data, like a display
in a loop constantly being written to with unchanging data, then you do nothing. This has advantage
that no display artifacts are created when display update is in a fast loop trying to update
but without any change needed. I found it "cleaned" up display from crap excessive writes
when only writes needed when things changed. Also potentially saves power.....
Keep in mind this address has gaps in it, depending on display character count, see the datasheet.
Eg. these are unused addresses. So you just account for these in you coding.
I looked at this problem eons ago and datasheet is not clear that anytime you can read
back cursor address. I think at the time I concluded it could not be done, which I thought
was odd.....
Regards, Dana.