Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Another interpolating problem

24 views
Skip to first unread message

Astro

unread,
Oct 6, 1998, 3:00:00 AM10/6/98
to
I can't seem to get the assembler right for interpolating two values, as a
matter of fact I'm so ashamed by my own sloppy code, that I won't post it
;).
Has someone a routine for this (*really* fast) preferrably in asm? Because
I'm kinda stuck on my project right now, I need some help on this, please.

(also see message from 5-10-98 by me/Astro : Interpolating in ASM)

Thanks,
Astro.

Bean

unread,
Oct 7, 1998, 3:00:00 AM10/7/98
to
>Has someone a routine for this (*really* fast) preferrably in asm? Because
>I'm kinda stuck on my project right now, I need some help on this, please.
>


Try this:

Function Interpolate(StartTime, EndTime, CurTime, StartValue, EndValue:
Word): Word; Assembler;
Asm
MOV AX,EndValue
SUB AX,StartValue
MOV BX,CurTime
SUB BX,StartTime
MUL BX
MOV BX,EndTime
SUB BX,StartTime
DIV BX
ADD AX,StartValue
End;

After I tested this I noticed that in your previous post you used longint
for the times. Well this should give you some help anyway. Let me know if
you need to use longints and I'll work on it.

Bean, th...@igateway.com

0 new messages