Pascal to BASM

From: Alexandru Preda (alexandru.preda_at_adpharma.ro)
Date: 02/20/05


Date: Sun, 20 Feb 2005 07:35:37 +0200

Hello,

I was wondering if anyone can help me converting the following function:

function LinearInterpolator(PWX, PWY: byte; C11, C21: PByte): byte;

    function CombineReg(X, Y, W: byte): byte;
     begin
          if W = 0 then
               Result := Y
          else if W = 255 then
               Result := X
          else Result := round(X * W/255 + (1 - W/255) * Y);
     end;

var C1, C3: byte;
begin
    if PWX > $FF then
        PWX := $FF;
    if PWY > $FF then
        PWY := $FF;

    C1 := C11^;
    Inc(C11);
    C3 := C21^;
    Inc(C21);

    Result := CombineReg(CombineReg(C1, C11^, PWX), CombineReg(C3, C21^,
PWX), PWY);
end;

Thank you in advance.
Alex



Relevant Pages

  • Re: Pascal to BASM
    ... Alexandru Preda wrote: ... > I was wondering if anyone can help me converting the following function: ... > PWX), PWY); ...
    (borland.public.delphi.language.basm)
  • multi-instances search with libPHP
    ... I've been converting from a function bassed design to a oops bases using libPHP, while looping through rows my program does two other selects, and things quit working suddenly, I think I just converted the cases selct to libPHP. ... var $Host ...
    (alt.php)
  • Re: Date Validation for dd-MMM-yyyy
    ... var d = new Date; ... month can be invalid. ... ISTM that 29-Feb-0000 will be considered not valid. ... If only converting to boolean, the date object is an object, and will ...
    (comp.lang.javascript)
  • Re: Bugs in CP/M 80 software
    ... If you are running Turbo Pascal 3.00A, CP/M-80, Z80, please ... compile the following "program": ... var r:real; ... an run time error which only occurs converting integer $8000 to ...
    (comp.os.cpm)
  • Re: FAQ Topic - How do I format a date with javascript? (2009-02-26)
    ... var dayOfMonth= padStr, 2, 0); ... function padStr { ... It looks like you have preference for converting the input of the ... @param {string} s: input to prefixed, ...
    (comp.lang.javascript)