Thread: Noob Questions
View Single Post
Old 18 January 2006, 23:44   #5
Codetapper
2 contact me: email only!

Codetapper's Avatar
 
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,166
Quote:
Originally Posted by gizmomelb
from qustion 2:

I seem to recall that if you were writing an AmigaDOS friendly loader, first you would allocate how much free memory you needed using system library calls - and you'd be returned the address where the free memory was. Then you'd load the file into that memory address, then JMP there if it was executable code.

something like that.. it's been a long time.
This method will not work with a lot of files, as they are split into various hunks and need to be relocated correctly. As an example, a file might be 200 bytes long consisting of 3 hunks, a piece of code, a BSS section of 200kb then another small piece of code. If you just allocate 200 bytes and read the file in, kaboom...
Codetapper is offline  
 
Page generated in 0.05433 seconds with 11 queries