From 512f48e9627683e781622a430576fa17450b91d5 Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Sat, 10 Apr 2004 09:38:38 +0000 Subject: [PATCH] Use pointer to MK_FP(0,0x5e0) to save a bit of code. git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@858 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/kernel/main.c b/kernel/main.c index be75f83..b54e38d 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -73,6 +73,7 @@ struct lol FAR *LoL = &DATASTART; VOID ASMCFUNC FreeDOSmain(void) { unsigned char drv; + unsigned char FAR *p; #ifdef _MSC_VER extern FAR prn_dev; @@ -87,17 +88,18 @@ VOID ASMCFUNC FreeDOSmain(void) at 50:e0 */ - if (fmemcmp(MK_FP(0x50,0xe0+2),"CONFIG",6) == 0) /* UPX */ + drv = LoL->BootDrive + 1; + p = MK_FP(0, 0x5e0); + if (fmemcmp(p+2,"CONFIG",6) == 0) /* UPX */ { - fmemcpy(&InitKernelConfig, MK_FP(0,0x5e0+2), sizeof(InitKernelConfig)); + fmemcpy(&InitKernelConfig, p+2, sizeof(InitKernelConfig)); - drv = *(UBYTE FAR *)MK_FP(0,0x5e0) + 1; - *(DWORD FAR *)MK_FP(0,0x5e0+2) = 0; + drv = *p + 1; + *(DWORD FAR *)(p+2) = 0; } else { - drv = LoL->BootDrive + 1; - *(UBYTE FAR *)MK_FP(0,0x5e0) = drv - 1; + *p = drv - 1; fmemcpy(&InitKernelConfig, &LowKernelConfig, sizeof(InitKernelConfig)); }