Hi!
12-Апр-2004 00:58 [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).
BO> not for me:
BO> case 0x11: /* normalise ASCIIZ filename */
BO> {
BO> char c;
BO> char FAR *s = MK_FP(r.DS, r.SI);
BO> 100D L$285:
Strange, how you get this listing? Your watcom.mak doesn't includes -d1
option. Also, even with this option wdis on inthndlr.obj desyncronizes and
big part of source not included into output.
BO> if (c >= 'a' && c <= 'z')
BO> 101F 3C 61 cmp al,0x61
BO> 1021 7C 08 jl L$287
BTW, this signed comparision may cause trouble in future - if you will
check not range, but one value, you get wrong result. For example, you can't
compare "c<' '", with signed char you should check "c>=0 && c<' '".
Well, I now recheck listings. Strange, but for Watcom adding (UBYTE)
into inthndlr.c doesn't changes anything. Although I already prepare bug
report:
______________O\_/_________________________________\_/O______________
Code generator:
- WPP promotes `char' to `int' too often:
; unsigned char c = *mem;
mov al,byte ptr [bx]
; if (c < ' ') c = '.';
mov dl,al
xor dh,dh
cmp dx,20H
jge L$14
mov al,2eH
With explicit cast this code reduced:
; if (c < (unsigned char)' ') c = '.';
mov al,byte ptr [bx]
cmp al,20H
jae L$14
mov al,2eH
_____________________________________________________________________
O/~\ /~\O
Probably, this is another difference between WCC and WPP code generators (I
already detect some). Anyway, adding casting helps for WPP and for BC:
______________O\_/_________________________________\_/O______________
; c -= 'a' - 'A';
mov al,cl
add al,224
mov cl,al
@[EMAIL PROTECTED]:
_____________________________________________________________________
O/~\ /~\O
______________O\_/_________________________________\_/O______________
; c -= (UBYTE)('a' - 'A');
sub cl,32
@[EMAIL PROTECTED]:
_____________________________________________________________________
O/~\ /~\O
>> > case 0x13:
>> > + r.AX = (unsigned char)r.callerARG1;
>> 1. Bug: RBIL says that returned AL, not AX.
>> 3. My code looks so:
BO> Something funny is going here. Your code by itself is a little smaller (5
What about the bug?
-------------------------------------------------------
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