Hi! - optimize for .callerARG1.
--- Begin Message ---diff -ruNp old/kernel/inthndlr.c new/kernel/inthndlr.c --- old/kernel/inthndlr.c 2004-05-31 07:29:14.000000000 +0000 +++ new/kernel/inthndlr.c 2004-05-31 07:36:16.000000000 +0000 @@ -1642,7 +1642,7 @@ struct int2f12regs { UWORD di, si, bp; xreg b, d, c, a; UWORD ip, cs, flags; - UWORD callerARG1; /* used if called from INT2F/12 */ + xreg callerARG1; /* used if called from INT2F/12 */ }; /* WARNING: modifications in `r' are used outside of int2F_12_handler() @@ -1683,11 +1683,11 @@ VOID ASMCFUNC int2F_12_handler(struct in break; case 0x06: /* invoke critical error */ - /* code, drive number, error, device header */ - r.AL = CriticalError(r.callerARG1 >> 8, - (r.callerARG1 & (EFLG_CHAR << 8)) ? 0 : - r.callerARG1 & 0xff, r.DI, MK_FP(r.BP, r.SI)); + r.AL = CriticalError(r.callerARG1.b.h, + (r.callerARG1.b.h & EFLG_CHAR) + ? 0 : r.callerARG1.b.l, + r.DI, MK_FP(r.BP, r.SI)); break; case 0x08: /* decrease SFT reference count */ @@ -1746,18 +1746,18 @@ VOID ASMCFUNC int2F_12_handler(struct in } case 0x12: /* get length of asciiz string */ - r.CX = fstrlen(MK_FP(r.ES, r.DI)) + 1; - break; - case 0x13: - /* uppercase character */ + case 0x13: /* uppercase character */ + { /* for now, ASCII only because nls.c cannot handle DS!=SS */ - r.AL = (unsigned char)r.callerARG1; - if (r.AL >= 'a' && r.AL <= 'z') - r.AL -= 'a' - 'A'; + unsigned char ch = r.callerARG1.b.l; + if (ch >= (UBYTE)'a' && ch <= (UBYTE)'z') + ch -= (UBYTE)('a' - 'A'); + r.AL = ch; break; + } case 0x16: /* get address of system file table entry - used by NET.EXE @@ -1793,10 +1793,9 @@ VOID ASMCFUNC int2F_12_handler(struct in ; ; probable use: get sizeof(CDSentry) */ - { - struct cds FAR *cdsp = get_cds(r.callerARG1 & 0xff); - - if (cdsp == NULL) + { + const struct cds FAR *cdsp; + if ((cdsp = get_cds(r.callerARG1.b.l)) == NULL) { r.FLAGS |= FLG_CARRY; break; @@ -1805,7 +1804,7 @@ VOID ASMCFUNC int2F_12_handler(struct in r.SI = FP_OFF(cdsp); r.FLAGS &= ~FLG_CARRY; break; - } + } case 0x18: /* get caller's registers */
--- End Message ---
