hi,
i wrote some macro to make positiion independant code for x86 in fasm.
in the files there is pic version of : MOV, OR, AND, ADD,SUB, INC,DEC
could you help me to optimize it, beceause they are very barbaric.
Position Independent Code in fasm
Position Independent Code in fasm
- Attachments
-
- pic.asm
- PIC macro for fasm
- (1.62 KiB) Downloaded 106 times
-
- Member
- Posts: 524
- Joined: Sun Nov 09, 2008 2:55 am
- Location: Pennsylvania, USA
Re: Position Independent Code in fasm
In x86_64 you can use RIP relative addressing, which basically does what you did without extra instructions. I think there is a comparable method for 32-bit code, but I'm not sure what it is.