Thread: Simple Question
View Single Post
Old 22 January 2009, 13:14   #14
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Quote:
Originally Posted by Ray Norrish View Post
I remember that (pc) only works within a word range? and I used to have countless arguments with fellow coders regarding "pc" coding styles.. but .. if you use the PC register, you can code independant code that can be loaded to any location, although for trackmos / independant loading of code, you can "org" your code and load it there - it will be fine.
On the 68020 and above you can use the extended addressing modes to achieve a PC-relative address with a 32 bit offset if needed.

The automatic code relocation feature in the AmigaOS is very comfortable and to me it doesn't make sense to go to lengths to avoid comfortable features.

If you can use a PC-relative address that's just great, and you should, but f.ex I would never write PC-relative LEA-MOVE constructs to get around single instances of not being able to use a PC-relative address as destination, but rather just take the absolute move with a reloc entry and let the AmigaOS do the work for me.
Leffmann is offline  
 
Page generated in 0.05677 seconds with 11 queries