Op Fri, 14 Mar 2008 20:15:44 +0200 schreef Marcel Hendrix:
> Coos Haak <chforth@[EMAIL PROTECTED]
> wrote Re: BETWEEN
> [..]
>> I disagree, using the pair >R and R> would be faster than -ROT, some
>> primitive implementations could define : ROT SWAP >R SWAP R> ;
>
>> But it would make no difference with a native compiler that makes full
use
>> of registers I assume.
> [..]
>
> FORTH> : between1 ( n1|u1 n2|u2 n3|u3 -- flag ) OVER - -ROT - U>= ;
ok
> FORTH> : between2 ( x l u -- f ) OVER - >R - R> U<= ; ok
> FORTH> ' between1 idis
> $005583C0 : [trashed]
> $005583C8 pop ebx
> $005583C9 pop ecx
> $005583CA sub ebx, ecx
> $005583CC pop edi
> $005583CD sub edi, ecx
> $005583CF cmp edi, ebx
> $005583D1 setbe bl
> $005583D4 movzx ebx, bl
> $005583D7 neg ebx
> $005583D9 push ebx
> $005583DA ;
> FORTH> ' between2 idis
> $00558440 : [trashed]
> $00558448 pop ebx
> $00558449 pop ecx
> $0055844A sub ebx, ecx
> $0055844C pop edi
> $0055844D sub edi, ecx
> $0055844F cmp ebx, edi
> $00558451 setae bl
> $00558454 movzx ebx, bl
> $00558457 neg ebx
> $00558459 push ebx
> $0055845A ;
>
> -marcel
I was pondering to use the three letters MHX in my message.
Glad I didn't. Thank you!
--
Coos
CHForth, 16 bit DOS applications
http://home.hccnet.nl/j.j.haak/forth.html


|