Re: Assemblers are for hiding your work , not for faster code .
- From: John Larkin <jjlarkin@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 12 Jan 2007 15:41:35 -0800
On 11 Jan 2007 07:58:11 -0800, "Didi" <dp@xxxxxxxxxxx> wrote:
Hi John,
... which was both bad and customer-visible.
I also have found out that this combination won't go from itself
in instrumentation making, eventually we have to act on it :-).
I tested it in PowerBasic (using 64-bit integer variables) and it does
seem to work. 4 lines of real code, not bad.
I am not quite sure what your assembler does, but the second "divu"
line seems suspicious to me (looks like you just overwrite the
remainder
from the first div and divide d1 instead).
I'm concatenating the 32-bit remainder (actually, 0..9) above the
32-bit low input. DIVU.Q divides 64/32, with a 32-bit quotient and a
32-bit remainder. Which makes it...
Given a 64-bit thing as H:L halves, each 32 bits,
Divide 0:H by 10 ; quotient is MS output, leaving remainder R
Concatenate R:L, divide by 10, and result is low output
I later realized that this is exactly (well, almost) the long-division
procedure we learned in 4th grade. The manual, decimal procedure is..
1. divide some arbitrary number of numerator digits by the
denominator, whatever you can handle, and post the quotient digits.
2. drop down the remainder, and drop one or more numerator digits to
the right of that,
3. Goto 1
I'm just doing it in fixed 32-bit chunks. Now, finally after all these
years, I sort of understand long division.
John
.
- Follow-Ups:
- References:
- Re: Assemblers are for hiding your work , not for faster code .
- From: ian . okey
- Re: Assemblers are for hiding your work , not for faster code .
- From: Ian Bell
- Re: Assemblers are for hiding your work , not for faster code .
- From: John Larkin
- Re: Assemblers are for hiding your work , not for faster code .
- From: Didi
- Re: Assemblers are for hiding your work , not for faster code .
- From: John Larkin
- Re: Assemblers are for hiding your work , not for faster code .
- From: Didi
- Re: Assemblers are for hiding your work , not for faster code .
- From: John Larkin
- Re: Assemblers are for hiding your work , not for faster code .
- From: Didi
- Re: Assemblers are for hiding your work , not for faster code .
- From: John Larkin
- Re: Assemblers are for hiding your work , not for faster code .
- From: Didi
- Re: Assemblers are for hiding your work , not for faster code .
- Prev by Date: Re: Embedded Software Engineers, needed in Seattle
- Next by Date: Re: Assemblers are for hiding your work , not for faster code .
- Previous by thread: Re: Assemblers are for hiding your work , not for faster code .
- Next by thread: Re: Assemblers are for hiding your work , not for faster code .
- Index(es):
Relevant Pages
|