Hi!

6-Апр-2004 23:51 [EMAIL PROTECTED] (Bart Oldeman) wrote to
[EMAIL PROTECTED]:

> +++ inthndlr.c        6 Apr 2004 23:51:33 -0000       1.68
>      case 0x11:                 /* normalise ASCIIZ filename */

     In my patch applied (UBYTE) casting for character literals (like 'a').
For OpenWatcom this reduces code (by eliminationg extraneous promotions byte
arguments to int).

>      case 0x13:
> +      r.AX = (unsigned char)r.callerARG1;
> +      if (r.AX >= 'a' && r.AX <= 'z')
> +        r.AX -= 'a' - 'A';

1. Bug: RBIL says that returned AL, not AX.
2. This code in any case may be optimized by reducing comparisions to bytes:

        if (r.AL >= (UBYTE)'a' && ...

3. My code looks so:

    case 0x13:          /* uppercase character */
    {
      /* for now, ASCII only because nls.c cannot handle DS!=SS */
      unsigned char ch = r.callerARG1;
      if (ch >= (UBYTE)'a' && ch <= (UBYTE)'z')
        ch -= (UBYTE)('a' - 'A');
      r.AL = ch;
      break;
    }

Don't remember about OW, but for BC this, at least, saves extra 3-byte JMP,
because there is extra operator between `if' and `break'. Also, BC doesn't
places intro registers structure fields, so my code also better in this
case.

> +        put_string("unimplemented internal dos function INT2F/12");
> +        put_unsigned(r.AL, 16, 2);

     What wrong in (shorter code):

put_string("unimplemented internal dos function INT2F/");
put_unsigned(r.AX, 16, 4);

?




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to