Mail Archives: djgpp/1998/10/28/18:20:08
In article <363782F1 DOT 7EA4 AT erols DOT com>, johnfine AT erols DOT com wrote:
>Jeramie Hicks wrote:
>>
>> I've been working on this code for about a week now with no result.
>> Could somebody point out what I'm doing wrong? All I want to do is
>> load a COM program into a chunk of allocated memory and then run it.
>.. . .
>> // allocate comdata to size of COM program
>> // fread COM program into comdata
>> codeptr = (functptr) comdata;
>> codeptr();
>
>> and then, the COM program compiled with MASM 6.1 with the /AT switch:
>>
>> .model TINY
>> .386
>> .code
>> equalfive proc
>> mov eax, 5
>> ret
>> equalfive endp
>> end equalfive
>
> I may not be remembering MASM switches and directives correctly, but
>I am nearly sure that .model TINY _always_ forces 16-bit defaults.
>Most instructions generated that way will not run correctly when
>the CPU is in 32-bit mode (as it is with DJGPP).
>
If you put .386 before .model tiny MASM will generate 32 bit code.
Paul Bosselaers
- Raw text -