I am digging with disassembler inside old game (release year 2002) and something is bugging me, I noticed it has a bunch of... questionable instructions. One of the things it does is calling imported functions indirectly through register, which seems totally unnecessary, example:
push someStringPointer
mov esi, dword ptr [->KERNEL32.DLL::OutputDebugStringA] ;pointer inside import table
call esi
This could be done without register, since you can just use the absolute address right away. Does using the register serve any purpose? Maybe it's a thing old compilers did? Or some kind of cheap measure against static reversing? I saw it occasionally uses the stored pointer to call something more than once, but it's rare, and doesn't sound like it would improve performance ( more often it wastes up to 3 different registers like that).
I'm using Ghidra to do the reverse engineering and it suggests that this game was compiled with MSVC compiler (it recognised a lot of standard functions from it).