I'm new to IDC scripts and would like some help at trying to apply and offset to a binary I have in loaded in IDA. Sorry not sure if my terminology is correct but I have a reference in my file "fp" that is the memory offset and is shown like
ld24 fp, #0x808000
all of the references in the file show something like,
lduh R0, @(-0x2700, fp)
which make it difficult to link the memory addresses. If I press Ctrl-R I can correct these offsets in the file line by line but I would like a script that can do the whole file in one go if possible.

this gives me what I am looking for
lduh R0, @((unk_805900 - unk_808000), fp)
Any help would be appreciated, thanks