I want to load a really small .com file (like 200 bytes or something) into an array and then run it. Am I doing this right?
int main()
{
unsigned char program[500]; // to store the program
int i; //some crap for some crap
FILE *fp; //to load the program
for(i=0i;<500;i++) // clear the array
program[i]='\0';
fp=fopen("program.com", "rb");
i=0;
while( program[i]=fgetc(fp) !=EOF ); // load it up
// sorry, donno how to do it without asm
asm{
mov bx, program[0]
jmp bx
}
return 0;
}
Do you think this would work or would I have to do it differently.