Re: A86: Input (yes another input question)


[Prev][Next][Index][Thread]

Re: A86: Input (yes another input question)




Ok, here's an example.  Say you want to unroll a loop 4 times.  This code
isn't any particular language.  ;-)

loop(times)
{
  select case (times AND 3)        ; the remainder from four (modulo 4)
   case 3:
     ; loop code
  case 2:
     ; loop code
  case 1:
    ; loop code
  case 0:
 for x = 0 to times step 4
 {
   ; loop code
   ; loop code
   ; loop code
   ; loop code
 }
}

The purpose of this is to handle the odd cases left over if the number of
times to loop isn't a multiple of the unrolled number of times.

-----Original Message-----
From: ComAsYuAre@aol.com <ComAsYuAre@aol.com>
To: assembly-86@lists.ticalc.org <assembly-86@lists.ticalc.org>
Date: Sunday, October 04, 1998 3:23 PM
Subject: Re: A86: Input (yes another input question)


>
>In a message dated 10/4/98 5:12:11 PM Eastern Daylight Time,
electrum@tfs.net
>writes:
>
>> Recursive?  Are you sure are using the right term?  Recursive code is
code
>>  that calls it self.  It is used for such things as traversing linked
lists,
>>  binary trees, reversing data, etc.  Did you mean a loop?  Also, it is
>>  possible to unroll a loop that is not run for a predetermined number of
>>  times.   Anyone heard of Duff's Device (a C thing)?
>
>
>i dunno. i guess i'm mixed up.  loop, recursion, whatever :)
>
>as for that Duff's Device thing, never heard of it.
>