Hi!

11-Июн-2006 02:08 [EMAIL PROTECTED] (Blair Campbell) wrote to
[EMAIL PROTECTED]:

BC> +++ dir.c   11 Jun 2006 02:08:08 -0000      1.27
BC> +    r.r_flags = 1;
BC>     intr(0x21, &r);

      Bug! You shouldn't rely on undocumented behavior! Adn you can't rely on
this, because no one int*() function (including intr()) sets flags _from_
r_flags! If you wish to set flags before interrupt, then there is only one
way to do this: write your own.  :(

BC> -     if (!r.x.cflag) {
BC> +      if (!( r.r_flags & 1 )) {

      Why not define macro like

#define isCarry(flag) ((flag) & 1)
if (!isCarry (r.r_flags))

or

#define Carry_FLAG 1
if (!(r.r_flags & Carry_FLAG))

BC>    /* Note: RBIL carry clear and al==0 also means unimplemented
BC>       alternately carry set and ax==undefined (usually unchanged) for
BC> unimplemented
BC>    */
BC> -  if(!r.x.cflag && r.h.al) {
BC> +  if(!( r.r_flags & 1 ) && r.r_ax) {

      Bug! r.r_ax is not same, as r.h.al!

BC> +  r.r_dx = toupper(*path) - 'A' + 1;

      Optimization (to help constants folding and eliminate extraneous
intermediate type promotions):

typedef unsigned char byte;
r.r_dx = (byte)(toupper(*path) - ('A' - 1));


_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to