LADSoft / OrangeC

OrangeC Compiler And Tool Chain
http://ladsoft.tripod.com/orange_c_compiler.html
Other
292 stars 39 forks source link

dpmi.c dpmi_get_memory_info(): 1 push and 0 pops #806

Closed FrenkelS closed 1 year ago

FrenkelS commented 1 year ago

The value of edi is pushed, but it doesn't get popped. I think push edi should be removed or pop edi should be added.

https://github.com/LADSoft/OrangeC/blob/5640ce35b7b231f1810e0d08d6f0d96d1df7b59a/src/clibs/platform/dos32/rtl/dpmi.c#L585

int _RTL_FUNC dpmi_get_memory_info( DPMI_FREEMEM_INFO *info)
{
    __asm push edi
    __asm mov edi,[info]
    __asm mov eax,0x500
    __asm int 0x31
    __asm mov eax,-1
    __asm jc xout
    __asm inc eax
xout:
}
LADSoft commented 1 year ago

ok thanks... do you need a new build of the DOS compiler? I haven't tried to build it in a long time, because I need to implement some sort of shared memory in DOS to get it working again... but I've been thinking it might not be too big of a deal to patch something minimal together that will satisfy the basic needs...

FrenkelS commented 1 year ago

Actually, I'm using CC386 and it also has this bug.

I've tried to compile Doom for DOS with OrangeC, but I couldn't get it to work.

So to answer your question: Do I need a new build of the DOS compiler? Not really.

LADSoft commented 1 year ago

yeah there have been a lot of improvements both to code generation and parsing since the last dos build.

Next push will fix this so I'm going to close it...