Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
the problem is that TCC (turbo C compiler) is a 16 bits compiler. It does not know anything about 32 bits registers or operations. In order to multiply long integers (32 bits), it requires a library that will provide the multiplication, division, etc. algorithms.
You should either locate that library and link with it or try to find a "enable 386 code" option for the compiler ... and hope it will allow it to generate native opcodes for 32 bits division (that the processor can handle, but that your compiler obviously ignores)
Tim Robinson wrote:
Turbo C probably requires an external routine (whose name is N_LXMUL@) to multiply two 32-bit variables. Consider switching to a 32-bit compiler -- if you're running DOS, use DJGPP; if you're running Windows, use Cygwin or Mingw.
it's like riding a bike in an F1 race. 16bit compilers are only capable of handling 16 bit data. To do 32bit stuff with a 16 bit compiler requires you to use an external assembler to compile the 32bit assembly code & data which the 16bit compiler can't handle.
eg 16 bit compilers on the x86 architecture can only handle registers ax,bx,.... and othe 16bit registers meaning the the upper 16bit part of the 32 bit registers like eax,ebx... can't be reached.
you might say but the compilers have long data types which are 32 bits. the compilers uses special library codes written in assembly which it links with your code to provide the needed support for the long data types. that why your having problems.
hope this helps