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 */
irp = (iregs FAR *)(exp->exec.stack - sizeof(iregs));
/* start allocating REGs */
irp->ES = irp->DS = ds;
/* start allocating REGs (as in MS-DOS - some demos expect them so --LG) */
/* see http://www.beroset.com/asm/showregs.asm */
irp->DX = irp->ES = irp->DS = ds;
irp->CS = FP_SEG(exp->exec.start_addr);
irp->IP = FP_OFF(exp->exec.start_addr);
irp->AX = fcbcode;
irp->BX = irp->CX = irp->DX = irp->SI = irp->DI = irp->BP = 0;
irp->SI = irp->IP = FP_OFF(exp->exec.start_addr);
irp->DI = FP_OFF(exp->exec.stack);
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;
if (InDOS)