Re: Fastcode UpperCase B&V 0.2

From: Les Pawelczyk (les_at_pixelpointpos_dot_com)
Date: 10/01/03


Date: Wed, 1 Oct 2003 12:31:45 -0400


(It's so simple, I don't know why it hasn't been done before)
> :-
>
> {Convert character in AL to Uppercase}
> sub al, 'a'
> sub al, 26
> sbb ecx, ecx
> and cl, -$20
> add al, 'a'+26
> add al, cl

I've done something similar before:

 cmp al, 'z'
 seta ah
 cmp al, 'a'
 adc ah, $1f
 or ah, $df
 and al, ah

I have abandoned above approach for lookup table solution. But your example
gives me some SSE ideas since SBB functionality can be replaced by PCMPGTB.

Les.



Relevant Pages

  • Re: Fastest way to highlight printable ASCII?
    ... cmp al,33 ... or ah,00001000b {highlight foreground by setting intensity bit} ... loop @writeloopfast ... sub al,33 ...
    (comp.lang.asm.x86)
  • Re: All is right !
    ... call convert;modify AL set carry/NC on error/GOOD ... mov dx, ... cmp al,3ah ... sub al,07h ...
    (alt.lang.asm)
  • Re: specify cell selection in a marco
    ... Sub Uppercase() ... ' Loop to cycle through each cell in the specified range. ... ' Change the text in the range to uppercase letters. ...
    (microsoft.public.excel.misc)
  • Re: Woz range check code explanation?
    ... > cmp #$0A ... The 6502 did not have a SUB instructions, just a SBB which ... To save this instruction, Steve used an EOR which works because N1 is 0x30, ...
    (comp.lang.asm.x86)
  • Re: automatically changing text case
    ... Sub TextConvert() ... 'By Ivan F Moala ... Dim ocell As Range ... > I am merging several different excel spreadsheets and some of the names are in all uppercase and some are first initial of name in uppercase and the rest in lowercase. ...
    (microsoft.public.excel.misc)