Hi!

19-Июн-2003 00:59 [EMAIL PROTECTED] (Bernd Blaauw) wrote to [EMAIL PROTECTED]:

BB> http://osdn.dl.sourceforge.net/sourceforge/freedos/ke2030src.zip

     Thank you. My comments.

Again time stamps shifted at 5 hours forward. :( Unfortunately, I doesn't
adopt UnZip with its exotic requirements for presence of TZ variable...

asmsupt.asm/domemcpy,domemset: `jcxz' there are superfluous (REPs are safe
when CX=0). Only before `repne scasb' inside fmemchr jcxz is useful (but it
may also superfluous, if previous code guarantees that ZF=1).

console.asm/line 141: wrong name in comment?

intr.asm: "pop ax/mov [...],ax" -> "pop [...]".

intr.asm: keycheck() (used only in config.c/Numlock()!) calls INT 16/1, even
on extended keyboards.

intr.asm: some functions have common tail (close/read/dup2 have "mov
bx,[bx+2]/int 21h/jmp short common_exit"; _init_setdrive/_init_switchar have
"mov bx/mov dl/int/ret"). Also, why not make (some) functions with Pascal
calling convention ("ret 2" in case of _init_setdrive/_init_switchar)?

intr.asm/line 285: label exec_no_error not ended by colon. Bug?

config.c/line 48,main.c/line 43: looks like comment is obsolete.

config.c/configDone: "(HMAFree + 0xF)/16 + 1" -> "(HMAFree + 16 + 15) / 16".

config.c/CfgSwitches: "if ('=' != *pline)" - note, MS-DOS allows statements
without equal sign (for example, "device himem.sys").

config.c/KernelAllocPara:
        if (base == start) {
                ...
                mcb_init (base + 1, ...
                ...base + 1...
                p->... = ...
                base++;
        }
replace by:
        if (base == start) {
                mcb_init (base + 1, MCB (base)->m_size - 1,
                                    MCB (base)->m_type);
                mumcb_init (base, 0);
                MCB (base)->name [1] = 'C';
                base++;
        }

config.c/KernelAllocPara: "+-(nPara+1)" used more often than "nPara".

config.c/KernelAllocPara:
        base += nPara + 1;
        if (mode)
                umb_base_seg = base;
        else
                base_seg = base;
        return MK_FP (FP_SEG (p) + 1, 0);
replace by:
        (mode ? umb_base_seg : base_seg) = base + nPara + 1;
        return MK_FP (base + 1, 0);

config.c/KernelAlloc: "p = KernelAllocPara ((nBytes+15)/16" -> "p =
KernelAllocPara (nPara".

config.c/mcb_init: what about third parameter `m_type'?

config.c/mcb_init:
        for (...) mcbp->m_name [i] = '\0';
replace by:
        ((word far*)(MCB (seg)->name) [0] = 0; /* or fmemset */
        ((word far*)(MCB (seg)->name) [1] = 0;
        ((word far*)(MCB (seg)->name) [2] = 0;
        ((word far*)(MCB (seg)->name) [3] = 0;

config.c/mumcb_init: replace by:
        mcb_init (seg, size, MCB_NORMAL);
        MCB (seg)->m_psp = 8;
        MCB (seg)->name [0] = 'S';
        MCB (seg)->name [1] = 'C';

config.c/GetNumber: replace by:
        STATIC const byte *getnumber (REG const byte *p, REG count *num) {
                byte nase = 10;
                count sign = 0, v = 0;
                if (*p == '-') { sign = -1, p++ }

                for (;; p++) {
                        byte ch = *p; /*!!! byte should be unsigned !!!*/
                        /* below ASCII tricks */
                        if (ch > '9') {
                                ch = (ch-1) & ~0x20;
                                if (ch == 'X'-1) {
                                        base = 16; continue;
                                }
                                ch -= 'A' - '0' - 11;
                        }
                        /* modulo arithmetics trick */
                        ch -= '0'; if (ch >= base) break;
                        v = v * base + ch;
                }

                *num = (v ^ sign) - sign; /* complement arithmetics */
                return p;
        }

dyninit.c: MK_FP used without explicit castings.

dsk.c,inthndlr.c: not (re)moved history comment at file end.

main.c/FreeDOSmain:
        LoL->BootDrive = ...
        if (LoL->BootDrive >= 0x80) ...
                LoL->BootDrive = ...
replace by:
        byte drv = ...
        if (drv >= 0x80)
                drv = ...
        LoL->BootDrive = drv;

main.c: isn't "MK_FP (0,0x5E0)" should be shorter than "MK_FP (0x50,0xE0)"?

main.c/init_device:
char *p;

fmemset(name, 0, 8);
        char *p;
        fmemset (name, 0, 8);
        for (p = cmdLine; *p && *p != ' ' && *p != '\t'; p++);
        while (p >= cmdLine && *p != '\\' && *p != '/' && *p != ':') p--;
        p++;
        for (i = 0; i < 8 && p[i] && p[i] != '.'; i++)
                name[i] = p[i];
replace by:
        char *p = cmdLine, *q = p;
        while (*p && *p != ' ' && *p != '\t') {
                if (*p == '\\' && *p == '/' && *p == ':')
                        q = p;
                p++;
        }
        for (i = 0; i < 8; i++) {
                char ch = *++q;
                if (ch == '\0' || ch == '.')
                        q--, ch = 0;
                name [i] = ch;
        }

==^================================================================
This email was sent to: [EMAIL PROTECTED]

EASY UNSUBSCRIBE click here: http://topica.com/u/?b1ddyi.b3hwCs.YXJjaGl2
Or send an email to: [EMAIL PROTECTED]

TOPICA - Start your own email discussion group. FREE!
http://www.topica.com/partner/tag02/create/index2.html
==^================================================================



Reply via email to