Adjust registers used when starting programs. Some demos expect

undocumented values.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@660 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2003-08-28 20:47:25 +00:00
parent 517fca72ae
commit 4e0c27f016

View File

@ -304,12 +304,16 @@ int load_transfer(UWORD ds, exec_blk *exp, UWORD fcbcode, COUNT mode)
/* build the user area on the stack */ /* build the user area on the stack */
irp = (iregs FAR *)(exp->exec.stack - sizeof(iregs)); irp = (iregs FAR *)(exp->exec.stack - sizeof(iregs));
/* start allocating REGs */ /* start allocating REGs (as in MS-DOS - some demos expect them so --LG) */
irp->ES = irp->DS = ds; /* see http://www.beroset.com/asm/showregs.asm */
irp->DX = irp->ES = irp->DS = ds;
irp->CS = FP_SEG(exp->exec.start_addr); irp->CS = FP_SEG(exp->exec.start_addr);
irp->IP = FP_OFF(exp->exec.start_addr); irp->SI = irp->IP = FP_OFF(exp->exec.start_addr);
irp->AX = fcbcode; irp->DI = FP_OFF(exp->exec.stack);
irp->BX = irp->CX = irp->DX = irp->SI = irp->DI = irp->BP = 0; irp->BP = 0x91e; /* this is more or less random but some programs
expect 0x9 in the high byte of BP!! */
irp->AX = irp->BX = fcbcode;
irp->CX = 0xFF;
irp->FLAGS = 0x200; irp->FLAGS = 0x200;
if (InDOS) if (InDOS)